Code Monkey home page Code Monkey logo

identityserver3.admin.entityframework's People

Contributors

brockallen avatar chicoribas avatar iboonz avatar leastprivilege avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

identityserver3.admin.entityframework's Issues

Customizing Clients

Is it possible to add columns to the Clients table to store additional data (similar to what you can do to the UserAccounts table in IdentityServer using generics)? If not, is that a change that you would see as good for the product?

Thanks

ConnectionString from Web.Config

In the file /source/Host/Config/IdentityAdminManagerService.cs you use the connection string NAME instead of complete Connection String...It's correct? because it doesn't work with the connection string NAME (in this case "IdSvr3ConfigAdmin").

I think that in IdentityAdminCoreManager constructor should read connection string from Web.Config...instead it pass to the factory the Connection String NAME...!?!?

public IdentityAdminManagerService()
            : base("IdSvr3ConfigAdmin")
        {
}

Is this correct or I missing something in my configuration?
Where to set correct connection string to DB..?
Thanks

Custom Default Values for new Clients and Scopes

Is there a possibility to define our Default values for new Clients and Scops? We like to change the following settings for clients:

  • AbsoluteRefreshTokenLifetime --> 2592000
  • EnableLocalLogin --> False
  • Enable --> true
  • RequireConsent --> false
  • LogoutSessionRequired --> true
  • AllowAccessTokensViaBrowser --> True

and for scopes:

  • Enable --> True
  • ShowInDiscoveryDocument --> True

Many Thanks
Regards,
Joël

Could not load type 'AutoMapper.IMapperConfiguration' from assembly AutoMapper, Version=5.1.1.0

I recently upgraded my IdentityServer3 project to the latest build. In that same project I am using the package IdentityServer3.Admin.EntityFramework package to manage Clients and Scopes. Now when I run the project to access the admin panel, I get the following error.

{"Could not load type 'AutoMapper.IMapperConfiguration' from assembly 'AutoMapper, Version=5.1.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005'.":"AutoMapper.IMapperConfiguration"}

   at IdentityServer3.Admin.EntityFramework.IdentityAdminCoreManager`4..ctor(String connectionString, String schema, Boolean createIfNotExist)
   at Pablow.IdentityServer.Admin.IdentityAdminManagerService..ctor() in e:\Sonu\Dev\PablowWebApp\Src\Pablow\Pablow.IdentityServer\Admin\IdentityAdminManagerService.cs:line 12
   at lambda_method(Closure , Object[] )
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() in c:\dev\git\IdentityServer3.Admin\source\Core\Configuration\Hosting\AutofacScope.cs:line 0

I guess it is due to the fact that latest IdentityServer3 package upgraded the AutoMapper to the latest version and Admin part is using the old version.

Can you please confirm or let me know how I can fix this?

IdentityServer3 Version

Hello.
This library seems to be not working with newest IdentityServer3 version 2.3.0. Is there any possibility to upgrade library dependencies? Also, current Entity Model is not cooperating with new IdentityServer3. "LogoutSessionRequired" field in IdentityClient Entity Class is missing.
Thank you

Securing Admin App

I'm looking for best practice guidance wrt securing the admin app in a production environment. Any pointers?

It occurs to me that I can run a single instance of the admin app and manage multiple different environments by mapping each environment to a different path. Is this practical or wise?

Bug in QueryScopesAsync()?

In IdentityAdminCoreManager.cs, method QueryScopesAsync(), I find these lines:

                    var scope = new ScopeSummary
                    {
                        Subject = x.Id.ToString(),
                        Name = x.Name,
                        Description = x.Name
                    };

I guess it is by accident that you copy the scope's name to both summary's name AND description, right?

ClientConfigurationDbContext

I get the below error using the latest release :

{"message":"An error has occurred.","exceptionMessage":"The model backing the 'ClientConfigurationDbContext'
 context has changed since the database was created. Consider using Code First Migrations to update the
 database (http://go.microsoft.com/fwlink/?LinkId=238269).","exceptionType":"System.InvalidOperationException"
,"stackTrace":"   at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context
)\r\n   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction
>b__e()\r\n   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action
)\r\n   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()\r\n   at System
.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)\r\n   at System
.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)\r\n   at System.Data.Entity.Internal
.LazyInternalContext.InitializeDatabaseAction(Action`1 action)\r\n   at System.Data.Entity.Internal.LazyInternalContext
.InitializeDatabase()\r\n   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType
(Type entityType)\r\n   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()\r\n   at System
.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()\r\n   at System.Data.Entity.Internal.Linq
.InternalSet`1.get_Local()\r\n   at System.Data.Entity.DbSet`1.get_Local()\r\n   at IdentityServer3.EntityFramework
.DbModelBuilderExtensions.RegisterClientChildTablesForDelete[TClient](DbContext ctx) in c:\\git\\identity
\\server3\\EntityFramework\\Source\\Core.EntityFramework\\Extensions\\DbModelBuilderExtensions.cs:line
 31\r\n   at IdentityServer3.EntityFramework.ClientConfigurationDbContext.ConfigureChildCollections(
) in c:\\git\\identity\\server3\\EntityFramework\\Source\\Core.EntityFramework\\DbContexts\\ClientConfigurationDbContext
.cs:line 40\r\n   at IdentityServer3.Admin.EntityFramework.IdentityAdminCoreManager`4.QueryClientsAsync
(String filter, Int32 start, Int32 count) in c:\\git\\identity\\server3admin\\EntityFramework\\source
\\IdentityServer3.Admin.EntityFramework\\IdentityAdminCoreManager.cs:line 616\r\n   at IdentityAdmin
.Api.Controllers.ClientController.<GetClientsAsync>d__4.MoveNext() in c:\\git\\identity\\server3admin
\\Admin\\source\\Core\\Api\\Controllers\\ClientController.cs:line 83\r\n--- End of stack trace from previous
 location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
(Task task)\r\n   at System.Threading.Tasks.System.Web.Http866082.TaskHelpersExtensions.<CastToObject
>d__3`1.MoveNext() in c:\\git\\identity\\server3admin\\Admin\\source\\Core\\Extensions\\PropertyMetadataExtensions
.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System
.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices
.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers
.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() in c:\\git\\identity\\server3admin
\\Admin\\source\\Core\\Extensions\\PropertyMetadataExtensions.cs:line 0\r\n--- End of stack trace from
 previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter
.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext
() in c:\\git\\identity\\server3admin\\Admin\\source\\Core\\Extensions\\PropertyMetadataExtensions.cs
:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System
.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() in c:\\git\\identity
\\server3admin\\Admin\\source\\Core\\Extensions\\PropertyMetadataExtensions.cs:line 0\r\n--- End of stack
 trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices
.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0
.MoveNext() in c:\\git\\identity\\server3admin\\Admin\\source\\Core\\Extensions\\PropertyMetadataExtensions
.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System
.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices
.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers
.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() in c:\\git\\identity\\server3admin\\Admin\\source\
\Core\\Extensions\\PropertyMetadataExtensions.cs:line 0\r\n--- End of stack trace from previous location
 where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore
>d__2.MoveNext() in c:\\git\\identity\\server3admin\\Admin\\source\\Core\\Extensions\\PropertyMetadataExtensions
.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System
.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices
.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers
.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext() in c:\\git\\identity\\server3admin\\Admin\
\source\\Core\\Extensions\\PropertyMetadataExtensions.cs:line 0\r\n--- End of stack trace from previous
 location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext() in
 c:\\git\\identity\\server3admin\\Admin\\source\\Core\\Extensions\\PropertyMetadataExtensions.cs:line
 0"}

i am running it against IdentityServer3 5.2.3
Thanks

Oracle support

Hello,

I followed steps from Support for other RDBMS than SQL Server for adding Oracle support.

But ran into issues trying IdentityAdmin and followed the trail to IdentityAdminCoreManager.cs that uses hard coded DB context instances.

At first I thought I could just write my own service like shown here, copy paste the entire IdentityAdminCoreManager code, and then modify all contexts with my own

  • maintenance hell in my opinion if I ever want to use updated manager class

Then I thought I could create a new class constructor that accepts DB contexts but being very new to EF, I wasn't sure of impacts this would cause having single instance of each DB context. I noticed manager class methods creates and disposes a context instance each time it is invoked

So I am trying out this 3rd option where I can set the type of context and use that to create an instance. It's working great.

designsinnovate@3b05a0e

Could you please review the change when you get a chance? I will go ahead and update rest of the class and submit a pull request if this approach seems ok.

Thanks

Problem with admin log in from remote machine

Hello, we are dealing with the following problem:

We have downloaded the project, updated its nuget packages to latest (specifically for IdentityServer3 version 2.5.0). We added the test ssl that you provide (idsrv3test.pfx) but we are having an issue when we try to login if the application runs on a remote machine. The application starts normal and after clicking on the login button we get a blank page due to an authorization error.

There is no problem if we run the application from a local machine.

Do you have any idea why is it happening and how to fix it? If the problem is because of the ssl can we disable it?

Thanks in advance.

Display option hint in UI (description)

Not sure how easy this would be to implement, but doing something like what intellisense does, where just beneath each option, there's some hint text explain what the option does. Could use the summary text from the model properties.

i.e.

/// <summary>
/// Specifies whether this scope is allowed to see other scopes when using the introspection endpoint
/// </summary>
public bool AllowUnrestrictedIntrospection { get; set; }

Please target .net 4.6

I get the following when installing the 1.0.0-beta1:

Severity Code Description Project File Line Suppression State
Error Could not install package 'IdentityServer3.Admin 1.0.0-beta1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0

UI shows up, but nothing seems to work.

I'm trying to configure the IdentityAdmin w/ EntityFramework but somehow I can't work it out.

I've created a custom IdentityAdminService class, like in the Host example

public class IdentityAdminManagerService : IdentityAdminCoreManager<IdentityClient, int, IdentityScope, int>
{
  public IdentityAdminManagerService(string connectionString)
    : base(connectionString)
    {
    }
}

and using it in the Startup.cs as follows:

var factory = new IdentityAdminServiceFactory
{
  IdentityAdminService = new Registration<IIdentityAdminService, IdentityAdminManagerService>(configurationDbConnectionStringName)
};

When browsing to the application the IdentityAdmin UI shows up, but I can't do anything there and also the already configured clients and scopes aren't visble.

Can you give me a hint where to look further?

Resolve custom dependencies

I use Unity in my project to register and resolve dependency. To tell AutoFac how to resolve a custom dependency a write the following working code for my IdentityServerServiceFactory

IdentityManagerServiceFactory factory;
factory.Register(new Registration<RoleManager<PlatosRole, Guid>>(res => (RoleManager<PlatosRole, Guid>)ServiceLocator.Current.GetInstance<IPlatosRoleManager>()));

I couldn't resolve my custom dependency for the IdentityAdminServiceFactory, because the Register method has only a parameter for an optional string.

IdentityAdminServiceFactory factory;
factory.IdentityAdminService = new Registration<IIdentityAdminService, IdentityAdminManagerService>();

I need a way to tell autofac, how it should resolve my dependencies, because in the IdentityAdminManagerServiceI need my IDatabaseConfiguration, which could not resolved at the moment:

public IdentityAdminManagerService(IDatabaseConfiguration databaseConfiguration)
      : base("IdentityDbContext")
{
   // databaseConfiguration could not resolve here!!
}

What is the correct way to resolve my dependency in the Register method of IdentityAdminServiceFactory ??

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.