Table of Contents

Interface IIdentityServerInteractionService

Namespace
Duende.IdentityServer.Services
Assembly
Duende.IdentityServer.dll

Provide services be used by the user interface to communicate with IdentityServer.

public interface IIdentityServerInteractionService

Methods

CreateLogoutContextAsync()

Used to create a logoutId if there is not one presently.

Task<string?> CreateLogoutContextAsync()

Returns

Task<string>

DenyAuthorizationAsync(AuthorizationRequest, AuthorizationError, string?)

Triggers error back to the client for the authorization request. This API is a simpler helper on top of GrantConsentAsync.

Task DenyAuthorizationAsync(AuthorizationRequest request, AuthorizationError error, string? errorDescription = null)

Parameters

request AuthorizationRequest

The request.

error AuthorizationError
errorDescription string

Returns

Task

GetAllUserGrantsAsync()

Returns a collection representing all of the user's consents and grants.

Task<IEnumerable<Grant>> GetAllUserGrantsAsync()

Returns

Task<IEnumerable<Grant>>

GetAuthorizationContextAsync(string?)

Gets the authorization context.

Task<AuthorizationRequest?> GetAuthorizationContextAsync(string? returnUrl)

Parameters

returnUrl string

The return URL.

Returns

Task<AuthorizationRequest>

GetErrorContextAsync(string?)

Gets the error context.

Task<ErrorMessage?> GetErrorContextAsync(string? errorId)

Parameters

errorId string

The error identifier.

Returns

Task<ErrorMessage>

GetLogoutContextAsync(string?)

Gets the logout context.

Task<LogoutRequest> GetLogoutContextAsync(string? logoutId)

Parameters

logoutId string

The logout identifier.

Returns

Task<LogoutRequest>

GrantConsentAsync(AuthorizationRequest, ConsentResponse, string?)

Informs IdentityServer of the user's consent.

Task GrantConsentAsync(AuthorizationRequest request, ConsentResponse consent, string? subject = null)

Parameters

request AuthorizationRequest

The request.

consent ConsentResponse

The consent.

subject string

The subject.

Returns

Task

IsValidReturnUrl(string?)

Indicates if the returnUrl is a valid URL for redirect after login or consent.

bool IsValidReturnUrl(string? returnUrl)

Parameters

returnUrl string

The return URL.

Returns

bool

RevokeTokensForCurrentSessionAsync()

Revokes all of a user's consents and grants for clients the user has signed into during their current session.

Task RevokeTokensForCurrentSessionAsync()

Returns

Task

RevokeUserConsentAsync(string?)

Revokes all a user's consents and grants for a given client, or for all clients if clientId is null.

Task RevokeUserConsentAsync(string? clientId)

Parameters

clientId string

The client identifier.

Returns

Task