Skip to content

Commit c2e7971

Browse files
committed
Openiddict 6
1 parent 61c5269 commit c2e7971

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

IdentityProvider/Controllers/AuthorizationController.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ public async Task<IActionResult> Authorize()
5353

5454
// If prompt=login was specified by the client application,
5555
// immediately return the user agent to the login page.
56-
if (request.HasPrompt(Prompts.Login))
56+
if (request.HasPromptValue(PromptValues.Login))
5757
{
5858
// To avoid endless login -> authorization redirects, the prompt=login flag
5959
// is removed from the authorization request payload before redirecting the user.
60-
var prompt = string.Join(" ", request.GetPrompts().Remove(Prompts.Login));
60+
var prompt = string.Join(" ", request.GetPromptValues().Remove(PromptValues.Login));
6161

6262
var parameters = Request.HasFormContentType ?
6363
Request.Form.Where(parameter => parameter.Key != Parameters.Prompt).ToList() :
@@ -82,7 +82,7 @@ public async Task<IActionResult> Authorize()
8282
{
8383
// If the client application requested promptless authentication,
8484
// return an error indicating that the user is not logged in.
85-
if (request.HasPrompt(Prompts.None))
85+
if (request.HasPromptValue(PromptValues.None))
8686
{
8787
return Forbid(
8888
authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme,
@@ -136,7 +136,7 @@ public async Task<IActionResult> Authorize()
136136
// return an authorization response without displaying the consent form.
137137
case ConsentTypes.Implicit:
138138
case ConsentTypes.External when authorizations.Any():
139-
case ConsentTypes.Explicit when authorizations.Any() && !request.HasPrompt(Prompts.Consent):
139+
case ConsentTypes.Explicit when authorizations.Any() && !request.HasPromptValue(PromptValues.Consent):
140140
var principal = await _signInManager.CreateUserPrincipalAsync(user);
141141

142142
// Note: in this sample, the granted scopes match the requested scope
@@ -169,8 +169,8 @@ public async Task<IActionResult> Authorize()
169169

170170
// At this point, no authorization was found in the database and an error must be returned
171171
// if the client application specified prompt=none in the authorization request.
172-
case ConsentTypes.Explicit when request.HasPrompt(Prompts.None):
173-
case ConsentTypes.Systematic when request.HasPrompt(Prompts.None):
172+
case ConsentTypes.Explicit when request.HasPromptValue(PromptValues.None):
173+
case ConsentTypes.Systematic when request.HasPromptValue(PromptValues.None):
174174
return Forbid(
175175
authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme,
176176
properties: new AuthenticationProperties(new Dictionary<string, string>

IdentityProvider/StartupExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
101101
{
102102
// Enable the authorization, logout, token and userinfo endpoints.
103103
options.SetAuthorizationEndpointUris("/connect/authorize")
104-
.SetLogoutEndpointUris("/connect/logout")
105-
.SetIntrospectionEndpointUris("/connect/introspect")
106-
.SetTokenEndpointUris("/connect/token")
107-
.SetUserinfoEndpointUris("/connect/userinfo")
108-
.SetVerificationEndpointUris("/connect/verify");
104+
.SetEndSessionEndpointUris("/connect/logout")
105+
.SetIntrospectionEndpointUris("/connect/introspect")
106+
.SetTokenEndpointUris("/connect/token")
107+
.SetUserInfoEndpointUris("/connect/userinfo")
108+
.SetEndUserVerificationEndpointUris("/connect/verify");
109109

110110
// Note: this sample uses the code, device code, password and refresh token flows, but you
111111
// can enable the other flows if you need to support implicit or client credentials.
@@ -127,9 +127,9 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
127127
// Register the ASP.NET Core host and configure the ASP.NET Core-specific options.
128128
options.UseAspNetCore()
129129
.EnableAuthorizationEndpointPassthrough()
130-
.EnableLogoutEndpointPassthrough()
130+
.EnableEndSessionEndpointPassthrough()
131131
.EnableTokenEndpointPassthrough()
132-
.EnableUserinfoEndpointPassthrough()
132+
.EnableUserInfoEndpointPassthrough()
133133
.EnableStatusCodePagesIntegration();
134134
})
135135

IdentityProvider/Worker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ await manager.CreateAsync(new OpenIddictApplicationDescriptor
5050
Permissions =
5151
{
5252
Permissions.Endpoints.Authorization,
53-
Permissions.Endpoints.Logout,
53+
Permissions.Endpoints.EndSession,
5454
Permissions.Endpoints.Token,
5555
Permissions.Endpoints.Revocation,
5656
Permissions.GrantTypes.AuthorizationCode,

0 commit comments

Comments
 (0)