Skip to content

Commit

Permalink
Update breaking changing
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Dec 18, 2024
1 parent f876e53 commit c54fe36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions OpeniddictServer/Controllers/AuthorizationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public async Task<IActionResult> Authorize()

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

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

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

// At this point, no authorization was found in the database and an error must be returned
// if the client application specified prompt=none in the authorization request.
case ConsentTypes.Explicit when request.HasPrompt(Prompts.None):
case ConsentTypes.Systematic when request.HasPrompt(Prompts.None):
case ConsentTypes.Explicit when request.HasPromptValue(PromptValues.None):
case ConsentTypes.Systematic when request.HasPromptValue(PromptValues.None):
return Forbid(
authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme,
properties: new AuthenticationProperties(new Dictionary<string, string>
Expand Down
1 change: 0 additions & 1 deletion OpeniddictServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void ConfigureServices(IServiceCollection services)
// (like pruning orphaned authorizations/tokens from the database) at regular intervals.
services.AddQuartz(options =>
{
options.UseMicrosoftDependencyInjectionJobFactory();
options.UseSimpleTypeLoader();
options.UseInMemoryStore();
});
Expand Down
4 changes: 2 additions & 2 deletions OpeniddictServer/Worker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ await manager.CreateAsync(new OpenIddictApplicationDescriptor
Permissions =
{
Permissions.Endpoints.Authorization,
Permissions.Endpoints.Logout,
Permissions.Endpoints.EndSession,
Permissions.Endpoints.Token,
Permissions.Endpoints.Revocation,
Permissions.GrantTypes.AuthorizationCode,
Expand Down Expand Up @@ -127,7 +127,7 @@ await manager.CreateAsync(new OpenIddictApplicationDescriptor
Permissions =
{
Permissions.Endpoints.Authorization,
Permissions.Endpoints.Logout,
Permissions.Endpoints.EndSession,
Permissions.Endpoints.Token,
Permissions.Endpoints.Revocation,
Permissions.GrantTypes.AuthorizationCode,
Expand Down

0 comments on commit c54fe36

Please sign in to comment.