Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Duende.​IdentityModel.​Client.​TokenClient
Assembly: Duende.IdentityModel
Inheritance: object → TokenClient
Client library for the OpenID Connect / OAuth 2 token endpoint
Methods
public
System.​Threading.​Tasks.​Task<​TokenResponse>
RequestClientCredentialsTokenAsync​(string scope = null,
Parameters parameters = null,
System.​Threading.​CancellationToken cancellationToken = null)
Sends a token request using the client_credentials grant type.
scope
The scope (space separated string).
parameters
Extra parameters.
cancellationToken
The cancellation token.
public
System.​Threading.​Tasks.​Task<​TokenResponse>
RequestDeviceTokenAsync​(string deviceCode,
Parameters? parameters = null,
System.​Threading.​CancellationToken cancellationToken = null)
Sends a token request using the urn:ietf:params:oauth:grant-type:device_code grant type.
deviceCode
The device code.
parameters
Extra parameters.
cancellationToken
The cancellation token.
public
System.​Threading.​Tasks.​Task<​TokenResponse>
RequestPasswordTokenAsync​(string userName,
string password = null,
string scope = null,
Parameters parameters = null,
System.​Threading.​CancellationToken cancellationToken = null)
Sends a token request using the password grant type.
userName
Name of the user.
password
The password.
scope
The scope (space separated string).
parameters
Extra parameters.
cancellationToken
The cancellation token.
public
System.​Threading.​Tasks.​Task<​TokenResponse>
RequestAuthorizationCodeTokenAsync​(string code,
string redirectUri,
string codeVerifier = null,
Parameters? parameters = null,
System.​Threading.​CancellationToken cancellationToken = null)
Sends a token request using the authorization_code grant type.
code
The code.
redirectUri
The redirect URI.
codeVerifier
The code verifier.
parameters
The parameters.
cancellationToken
The cancellation token.
public
System.​Threading.​Tasks.​Task<​TokenResponse>
RequestRefreshTokenAsync​(string refreshToken,
string scope = null,
Parameters? parameters = null,
System.​Threading.​CancellationToken cancellationToken = null)
Sends a token request using the refresh_token grant type.
refreshToken
The refresh token.
scope
The scope (space separated string).
parameters
Extra parameters.
cancellationToken
The cancellation token.
public
System.​Threading.​Tasks.​Task<​TokenResponse>
RequestTokenAsync​(string grantType,
Parameters? parameters = null,
System.​Threading.​CancellationToken cancellationToken = null)
Sends a token request.
grantType
Type of the grant.
parameters
Extra parameters.
cancellationToken
The cancellation token.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object