Method RedeemAuthorizationCodeAsync
- Namespace
- MailFathom.Common.MailboxOAuth
- Assembly
- MailFathom.Common.dll
RedeemAuthorizationCodeAsync(MailboxAuthorizationRequest, PendingAuthorization, string, CancellationToken)
Exchanges an authorization code the operator pasted back for a refresh token.
public Task<MailboxAuthorizationGrant> RedeemAuthorizationCodeAsync(MailboxAuthorizationRequest request, PendingAuthorization pendingAuthorization, string authorizationCode, CancellationToken cancellationToken)
Parameters
requestMailboxAuthorizationRequestThe provider endpoints and registered client.
pendingAuthorizationPendingAuthorizationThe authorization BuildAuthorization(MailboxAuthorizationRequest) produced, carrying the proof key the code is bound to.
authorizationCodestringThe code the redirect carried.
cancellationTokenCancellationTokenCancels the exchange.
Returns
- Task<MailboxAuthorizationGrant>
The grant to provision.
Exceptions
- ArgumentNullException
Thrown when an argument is null.
- MailboxAuthorizationFailedException
Thrown when the authorization server refused the exchange.