IdentityServer Interaction Service¶
The IIdentityServerInteractionService interface is intended to provide services to be used by the user interface to communicate with IdentityServer, mainly pertaining to user interaction.
It is available from the dependency injection system and would normally be injected as a constructor parameter into your MVC controllers for the user interface of IdentityServer.
IIdentityServerInteractionService APIs¶
GetAuthorizationContextAsyncReturns the
AuthorizationRequestbased on thereturnUrlpassed to the login or consent pages.IsValidReturnUrlIndicates if the
returnUrlis a valid URL for redirect after login or consent.GetErrorContextAsyncReturns the
ErrorMessagebased on theerrorIdpassed to the error page.GetLogoutContextAsyncReturns the
LogoutRequestbased on thelogoutIdpassed to the logout page.CreateLogoutContextAsyncUsed to create a
logoutIdif there is not one presently. This creates a cookie capturing all the current state needed for signout and thelogoutIdidentifies that cookie. This is typically used when there is no currentlogoutIdand the logout page must capture the current user’s state needed for sign-out prior to redirecting to an external identity provider for signout. The newly createdlogoutIdwould need to be round-tripped to the external identity provider at signout time, and then used on the signout callback page in the same way it would be on the normal logout page.GrantConsentAsyncAccepts a
ConsentResponseto inform IdentityServer of the user’s consent to a particularAuthorizationRequest.DenyAuthorizationAsyncAccepts a
AuthorizationErrorto inform IdentityServer of the error to return to the client for a particularAuthorizationRequest.GetAllUserGrantsAsyncReturns a collection of
Grantfor the user. These represent a user’s consent or a clients access to a user’s resource.RevokeUserConsentAsyncRevokes all of a user’s consents and grants for a client.
RevokeTokensForCurrentSessionAsyncRevokes all of a user’s consents and grants for clients the user has signed into during their current session.
ResourceValidationResult¶
ResourcesThe resources of the result.
ParsedScopesThe parsed scopes represented by the result.
RawScopeValuesThe original (raw) scope values represented by the validated result.
ErrorMessage¶
DisplayModeThe display mode passed from the authorization request.
UiLocalesThe UI locales passed from the authorization request.
ErrorThe error code.
RequestIdThe per-request identifier. This can be used to display to the end user and can be used in diagnostics.
LogoutRequest¶
ClientIdThe client identifier that initiated the request.
PostLogoutRedirectUriThe URL to redirect the user to after they have logged out.
SessionIdThe user’s current session id.
SignOutIFrameUrlThe URL to render in an
<iframe>on the logged out page to enable single sign-out.ParametersThe entire parameter collection passed to the end session endpoint.
ShowSignoutPromptIndicates if the user should be prompted for signout based upon the parameters passed to the end session endpoint.
ConsentResponse¶
ScopesValuesConsentedThe collection of scopes the user consented to.
RememberConsentFlag indicating if the user’s consent is to be persisted.
DescriptionOptional description the user can set for the grant (e.g. the name of the device being used when consent is given). This can be presented back to the user from the persisted grant service.
ErrorError, if any, for the consent response. This will be returned to the client in the authorization response.
ErrorDescriptionError description. This will be returned to the client in the authorization response.
Grant¶
SubjectIdThe subject id that allowed the grant.
ClientIdThe client identifier for the grant.
DescriptionThe description the user assigned to the client or device being authorized.
ScopesThe collection of scopes granted.
CreationTimeThe date and time when the grant was granted.
ExpirationThe date and time when the grant will expire.