Skip to content

Commit

Permalink
Update InteractiveChallengeRequest and InteractiveSignOutRequest to s…
Browse files Browse the repository at this point in the history
…upport attaching an identity token or login hint
  • Loading branch information
kevinchalet committed Feb 4, 2025
1 parent a18433d commit bd74a6c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ await _service.RevokeTokenAsync(new()
var nonce = (await _service.SignOutInteractivelyAsync(new()
{
CancellationToken = stoppingToken,
IdentityTokenHint = response.BackchannelIdentityToken ?? response.FrontchannelIdentityToken,
ProviderName = provider
})).Nonce;

Expand Down
22 changes: 22 additions & 0 deletions src/OpenIddict.Client/OpenIddictClientModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ public sealed record class InteractiveChallengeRequest
[EditorBrowsable(EditorBrowsableState.Advanced)]
public string? GrantType { get; init; }

/// <summary>
/// Gets or sets the optional identity token hint that will
/// be sent to the authorization server, if applicable.
/// </summary>
public string? IdentityTokenHint { get; set; }

/// <summary>
/// Gets or sets the optional login hint that will be sent to the authorization server, if applicable.
/// </summary>
public string? LoginHint { get; set; }

/// <summary>
/// Gets or sets the application-specific properties that will be added to the context.
/// </summary>
Expand Down Expand Up @@ -253,6 +264,17 @@ public sealed record class InteractiveSignOutRequest
/// </summary>
public CancellationToken CancellationToken { get; init; }

/// <summary>
/// Gets or sets the optional identity token hint that will
/// be sent to the authorization server, if applicable.
/// </summary>
public string? IdentityTokenHint { get; set; }

/// <summary>
/// Gets or sets the optional login hint that will be sent to the authorization server, if applicable.
/// </summary>
public string? LoginHint { get; set; }

/// <summary>
/// Gets or sets the application-specific properties that will be added to the context.
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions src/OpenIddict.Client/OpenIddictClientService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ public async ValueTask<InteractiveChallengeResult> ChallengeInteractivelyAsync(I
CancellationToken = request.CancellationToken,
CodeChallengeMethod = request.CodeChallengeMethod,
GrantType = request.GrantType,
IdentityTokenHint = request.IdentityTokenHint,
Issuer = request.Issuer,
LoginHint = request.LoginHint,
Principal = new ClaimsPrincipal(new ClaimsIdentity()),
ProviderName = request.ProviderName,
RegistrationId = request.RegistrationId,
Expand Down Expand Up @@ -1399,7 +1401,9 @@ public async ValueTask<InteractiveSignOutResult> SignOutInteractivelyAsync(Inter
var context = new ProcessSignOutContext(transaction)
{
CancellationToken = request.CancellationToken,
IdentityTokenHint = request.IdentityTokenHint,
Issuer = request.Issuer,
LoginHint = request.LoginHint,
Principal = new ClaimsPrincipal(new ClaimsIdentity()),
ProviderName = request.ProviderName,
RegistrationId = request.RegistrationId,
Expand Down

0 comments on commit bd74a6c

Please sign in to comment.