CommunicationIdentityClient.GetToken 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
GetToken(CommunicationUserIdentifier, IEnumerable<CommunicationTokenScope>, CancellationToken) |
Gets a Communication Identity access token for a CommunicationUserIdentifier. |
GetToken(CommunicationUserIdentifier, IEnumerable<CommunicationTokenScope>, TimeSpan, CancellationToken) |
Gets a Communication Identity access token for a CommunicationUserIdentifier. |
GetToken(CommunicationUserIdentifier, IEnumerable<CommunicationTokenScope>, CancellationToken)
Gets a Communication Identity access token for a CommunicationUserIdentifier.
public virtual Azure.Response<Azure.Core.AccessToken> GetToken (Azure.Communication.CommunicationUserIdentifier communicationUser, System.Collections.Generic.IEnumerable<Azure.Communication.Identity.CommunicationTokenScope> scopes, System.Threading.CancellationToken cancellationToken = default);
abstract member GetToken : Azure.Communication.CommunicationUserIdentifier * seq<Azure.Communication.Identity.CommunicationTokenScope> * System.Threading.CancellationToken -> Azure.Response<Azure.Core.AccessToken>
override this.GetToken : Azure.Communication.CommunicationUserIdentifier * seq<Azure.Communication.Identity.CommunicationTokenScope> * System.Threading.CancellationToken -> Azure.Response<Azure.Core.AccessToken>
Public Overridable Function GetToken (communicationUser As CommunicationUserIdentifier, scopes As IEnumerable(Of CommunicationTokenScope), Optional cancellationToken As CancellationToken = Nothing) As 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
Exceptions
The server returned an error.
Applies to
GetToken(CommunicationUserIdentifier, IEnumerable<CommunicationTokenScope>, TimeSpan, CancellationToken)
Gets a Communication Identity access token for a CommunicationUserIdentifier.
public virtual Azure.Response<Azure.Core.AccessToken> GetToken (Azure.Communication.CommunicationUserIdentifier communicationUser, System.Collections.Generic.IEnumerable<Azure.Communication.Identity.CommunicationTokenScope> scopes, TimeSpan tokenExpiresIn, System.Threading.CancellationToken cancellationToken = default);
abstract member GetToken : Azure.Communication.CommunicationUserIdentifier * seq<Azure.Communication.Identity.CommunicationTokenScope> * TimeSpan * System.Threading.CancellationToken -> Azure.Response<Azure.Core.AccessToken>
override this.GetToken : Azure.Communication.CommunicationUserIdentifier * seq<Azure.Communication.Identity.CommunicationTokenScope> * TimeSpan * System.Threading.CancellationToken -> Azure.Response<Azure.Core.AccessToken>
Public Overridable Function GetToken (communicationUser As CommunicationUserIdentifier, scopes As IEnumerable(Of CommunicationTokenScope), tokenExpiresIn As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As 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.
Returns
Exceptions
The server returned an error.
Applies to
Azure SDK for .NET