Interface IIdentityServerInteractionService
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Surfaces protocol request context to the interactive UI (login, consent, logout).
public interface IIdentityServerInteractionService
Methods
CreateLogoutContextAsync(CancellationToken)
Captures the current signed-in session as a logout id, or null when nobody is signed in.
Task<string?> CreateLogoutContextAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
DenyAuthenticationAsync(IAuthenticationContext, InteractionError, CancellationToken, string?)
Records a denial of any pending request, to be returned to the client as an error.
[SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "A parameter's position is part of the signature a host compiles against, and this order is the one existing hosts were written to.")]
Task DenyAuthenticationAsync(IAuthenticationContext context, InteractionError interactionError, CancellationToken cancellationToken = default, string? errorDescription = null)
Parameters
contextIAuthenticationContextinteractionErrorInteractionErrorcancellationTokenCancellationTokenerrorDescriptionstring
Returns
DenyAuthorizationAsync(AuthorizationRequest, InteractionError, CancellationToken, string?)
Records a denial of a pending authorization request, to be returned to the client as an error.
[SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "A parameter's position is part of the signature a host compiles against, and this order is the one existing hosts were written to.")]
Task DenyAuthorizationAsync(AuthorizationRequest request, InteractionError interactionError, CancellationToken cancellationToken = default, string? errorDescription = null)
Parameters
requestAuthorizationRequestinteractionErrorInteractionErrorcancellationTokenCancellationTokenerrorDescriptionstring
Returns
GetAllUserGrantsAsync(CancellationToken)
The consent the signed-in user has given, for an account-management screen.
Task<IReadOnlyCollection<Grant>> GetAllUserGrantsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
GetAuthenticationContextAsync(string?, CancellationToken)
Gets the pending request described by a return URL, whatever kind it is.
Task<IAuthenticationContext?> GetAuthenticationContextAsync(string? returnUrl, CancellationToken cancellationToken = default)
Parameters
returnUrlstringcancellationTokenCancellationToken
Returns
GetAuthorizationContextAsync(string?, CancellationToken)
Gets the authorization request described by a return URL, or null if it is not valid.
Task<AuthorizationRequest?> GetAuthorizationContextAsync(string? returnUrl, CancellationToken cancellationToken = default)
Parameters
returnUrlstringcancellationTokenCancellationToken
Returns
GetErrorContextAsync(string?, CancellationToken)
Gets the error context identified by errorId.
Task<ErrorMessage?> GetErrorContextAsync(string? errorId, CancellationToken cancellationToken = default)
Parameters
errorIdstringcancellationTokenCancellationToken
Returns
- Task<ErrorMessage>
Null when the id is absent, unknown, or has expired.
GetLogoutContextAsync(string?, CancellationToken)
Gets the signout request identified by logoutId.
Task<LogoutRequest> GetLogoutContextAsync(string? logoutId, CancellationToken cancellationToken = default)
Parameters
logoutIdstringcancellationTokenCancellationToken
Returns
Remarks
An absent or unreadable id yields a context that prompts the user to confirm.
GrantConsentAsync(AuthorizationRequest, ConsentResponse, CancellationToken, string?)
Records the user's decision on a pending authorization request.
[SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "A parameter's position is part of the signature a host compiles against, and this order is the one existing hosts were written to.")]
Task GrantConsentAsync(AuthorizationRequest request, ConsentResponse consent, CancellationToken cancellationToken = default, string? subject = null)
Parameters
requestAuthorizationRequestconsentConsentResponsecancellationTokenCancellationTokensubjectstring
Returns
IsValidReturnUrl(string?)
Whether the return URL is a valid local authorize URL.
bool IsValidReturnUrl(string? returnUrl)
Parameters
returnUrlstring
Returns
RevokeTokensForCurrentSessionAsync(CancellationToken)
Removes the tokens issued for the signed-in user's current session.
Task RevokeTokensForCurrentSessionAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
RevokeUserConsentAsync(string?, CancellationToken)
Withdraws the signed-in user's consent for a client.
Task RevokeUserConsentAsync(string? clientId, CancellationToken cancellationToken = default)
Parameters
clientIdstringcancellationTokenCancellationToken
Returns
Remarks
Consent alone: the tokens already issued under it are removed too, because leaving them would let a client the user has just disconnected keep acting on their behalf until those tokens expired.