CommunicationIdentityClient.GetTokenAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetTokenAsync(CommunicationUserIdentifier, IEnumerable<CommunicationTokenScope>, CancellationToken) |
Asynchronously gets a Communication Identity access token for a CommunicationUserIdentifier. |
GetTokenAsync(CommunicationUserIdentifier, IEnumerable<CommunicationTokenScope>, TimeSpan, CancellationToken) |
Asynchronously gets a Communication Identity access token for a CommunicationUserIdentifier. |
GetTokenAsync(CommunicationUserIdentifier, IEnumerable<CommunicationTokenScope>, CancellationToken)
Asynchronously gets a Communication Identity access token for a CommunicationUserIdentifier.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Core.AccessToken>> GetTokenAsync (Azure.Communication.CommunicationUserIdentifier communicationUser, System.Collections.Generic.IEnumerable<Azure.Communication.Identity.CommunicationTokenScope> scopes, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTokenAsync : Azure.Communication.CommunicationUserIdentifier * seq<Azure.Communication.Identity.CommunicationTokenScope> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Core.AccessToken>>
override this.GetTokenAsync : Azure.Communication.CommunicationUserIdentifier * seq<Azure.Communication.Identity.CommunicationTokenScope> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Core.AccessToken>>
Public Overridable Function GetTokenAsync (communicationUser As CommunicationUserIdentifier, scopes As IEnumerable(Of CommunicationTokenScope), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AccessToken))
Parameters
- communicationUser
- CommunicationUserIdentifier
The CommunicationUserIdentifier for whom to get a Communication Identity access token.
- scopes
- IEnumerable<CommunicationTokenScope>
List of CommunicationTokenScope scopes for the token.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Applies to
GetTokenAsync(CommunicationUserIdentifier, IEnumerable<CommunicationTokenScope>, TimeSpan, CancellationToken)
Asynchronously gets a Communication Identity access token for a CommunicationUserIdentifier.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Core.AccessToken>> GetTokenAsync (Azure.Communication.CommunicationUserIdentifier communicationUser, System.Collections.Generic.IEnumerable<Azure.Communication.Identity.CommunicationTokenScope> scopes, TimeSpan tokenExpiresIn, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTokenAsync : Azure.Communication.CommunicationUserIdentifier * seq<Azure.Communication.Identity.CommunicationTokenScope> * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Core.AccessToken>>
override this.GetTokenAsync : Azure.Communication.CommunicationUserIdentifier * seq<Azure.Communication.Identity.CommunicationTokenScope> * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Core.AccessToken>>
Public Overridable Function GetTokenAsync (communicationUser As CommunicationUserIdentifier, scopes As IEnumerable(Of CommunicationTokenScope), tokenExpiresIn As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AccessToken))
Parameters
- communicationUser
- CommunicationUserIdentifier
The CommunicationUserIdentifier for whom to get a Communication Identity access token.
- scopes
- IEnumerable<CommunicationTokenScope>
List of CommunicationTokenScope scopes for the token.
- tokenExpiresIn
- TimeSpan
Custom validity period of the token within [1,24] hours range.
- cancellationToken
- CancellationToken
The cancellation token to use.