IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Configure Identity Server in dotnetcore2

Open worldspawn opened this issue 9 years ago • 8 comments

I am trying to configure entity framework for identity server using the dotnet core rc1 libraries. This sample code

services.AddIdentityServer()
                .AddTemporarySigningCredential()
                .AddConfigurationStore(builder =>
                    builder.UseSqlServer(connectionString, options =>
                        options.MigrationsAssembly(migrationsAssembly)))
                .AddOperationalStore(builder =>
                    builder.UseSqlServer(connectionString, options =>
                        options.MigrationsAssembly(migrationsAssembly)));

does not compile. AddTemporarySigningCredential does not exist and (more importantly) builder.UseSqlServer does not exist. builder seems to be a different type than it was with dotnetcore1 so the extension method does not apply.

worldspawn avatar Sep 10 '17 04:09 worldspawn

Working on the same thing. You will need the 2.x packages on NuGet I think, which is currently still in "prerelease". At the time of writing v2.0.0-rc1 is the latest version.

See also #1055 (the upgrade issue) and #1057 (breaking changes list).

jeroenheijmans avatar Sep 10 '17 09:09 jeroenheijmans

Hi, I have the same problem, even after updating to rc1 I have the same issue, AddSigningCredential still doesn't exist.

HristoKolev avatar Sep 10 '17 09:09 HristoKolev

According to #1057:

AddTemporarySigningCredential => AddDeveloperSigningCredential

Check out that issue for more things that have changed.

jeroenheijmans avatar Sep 10 '17 09:09 jeroenheijmans

Thank you, I should have read that.

HristoKolev avatar Sep 10 '17 09:09 HristoKolev

Yeah UseSqlServer is the real issue. I'm using the 2.0 rc1 libraries.

worldspawn avatar Sep 10 '17 23:09 worldspawn

try:

var idsrvBuilder = services.AddIdentityServer()
               .AddDeveloperSigningCredential()
               .AddConfigurationStore(options =>
                   {
                       options.DefaultSchema = "token";
                       options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString);
                   }
               )
               .AddOperationalStore(options =>
                   {
                       options.DefaultSchema = "token";
                       options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString);
                   }
               );

vitalbsk avatar Sep 11 '17 04:09 vitalbsk

Much obliged @vitalbsk 👍

worldspawn avatar Sep 11 '17 05:09 worldspawn

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 14 '20 08:01 lock[bot]