|
|
|
@ -25,12 +25,12 @@ namespace Mvc.Server { |
|
|
|
options.UseSqlServer(configuration["Data:DefaultConnection:ConnectionString"])); |
|
|
|
|
|
|
|
// Register the Identity services.
|
|
|
|
services.AddIdentity<ApplicationUser, IdentityRole<Guid>>() |
|
|
|
.AddEntityFrameworkStores<ApplicationDbContext, Guid>() |
|
|
|
services.AddIdentity<ApplicationUser, IdentityRole>() |
|
|
|
.AddEntityFrameworkStores<ApplicationDbContext>() |
|
|
|
.AddDefaultTokenProviders(); |
|
|
|
|
|
|
|
// Register the OpenIddict services, including the default Entity Framework stores.
|
|
|
|
services.AddOpenIddict<ApplicationDbContext, Guid>() |
|
|
|
services.AddOpenIddict<ApplicationDbContext>() |
|
|
|
// Register the ASP.NET Core MVC binder used by OpenIddict.
|
|
|
|
// Note: if you don't call this method, you won't be able to
|
|
|
|
// bind OpenIdConnectRequest or OpenIdConnectResponse parameters.
|
|
|
|
@ -149,7 +149,7 @@ namespace Mvc.Server { |
|
|
|
// Type = OpenIddictConstants.ClientTypes.Confidential
|
|
|
|
// });
|
|
|
|
|
|
|
|
context.Applications.Add(new OpenIddictApplication<Guid> { |
|
|
|
context.Applications.Add(new OpenIddictApplication { |
|
|
|
ClientId = "myClient", |
|
|
|
ClientSecret = Crypto.HashPassword("secret_secret_secret"), |
|
|
|
DisplayName = "My client application", |
|
|
|
@ -167,7 +167,7 @@ namespace Mvc.Server { |
|
|
|
// * Scope: openid email profile roles
|
|
|
|
// * Grant type: authorization code
|
|
|
|
// * Request access token locally: yes
|
|
|
|
context.Applications.Add(new OpenIddictApplication<Guid> { |
|
|
|
context.Applications.Add(new OpenIddictApplication { |
|
|
|
ClientId = "postman", |
|
|
|
DisplayName = "Postman", |
|
|
|
RedirectUri = "https://www.getpostman.com/oauth2/callback", |
|
|
|
|