Table of Contents

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

request MailboxAuthorizationRequest

The provider endpoints and registered client.

pendingAuthorization PendingAuthorization

The authorization BuildAuthorization(MailboxAuthorizationRequest) produced, carrying the proof key the code is bound to.

authorizationCode string

The code the redirect carried.

cancellationToken CancellationToken

Cancels 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.