UserTokenClient class
Client for managing user tokens.
Constructors
User |
Creates a new instance of UserTokenClient. |
Properties
client |
Methods
exchange |
Exchanges the token. |
get |
Gets the AAD tokens. |
get |
Gets the sign-in resource. |
get |
Gets the token or sign-in resource. |
get |
Gets the token status. |
get |
Gets the user token. |
sign |
Signs the user out. |
update |
Constructor Details
UserTokenClient(string)
Creates a new instance of UserTokenClient.
new UserTokenClient(msAppId: string)
Parameters
- msAppId
-
string
The Microsoft application ID.
Property Details
client
client: AxiosInstance
Property Value
AxiosInstance
Method Details
exchangeTokenAsync(string, string, string, TokenExchangeRequest)
Exchanges the token.
function exchangeTokenAsync(userId: string, connectionName: string, channelId: string, tokenExchangeRequest: TokenExchangeRequest): Promise<TokenResponse>
Parameters
- userId
-
string
The user ID.
- connectionName
-
string
The connection name.
- channelId
-
string
The channel ID.
- tokenExchangeRequest
- TokenExchangeRequest
The token exchange request.
Returns
Promise<TokenResponse>
A promise that resolves to the exchanged token.
getAadTokens(string, string, string, AadResourceUrls)
Gets the AAD tokens.
function getAadTokens(userId: string, connectionName: string, channelId: string, resourceUrls: AadResourceUrls): Promise<Record<string, TokenResponse>>
Parameters
- userId
-
string
The user ID.
- connectionName
-
string
The connection name.
- channelId
-
string
The channel ID.
- resourceUrls
- AadResourceUrls
The resource URLs.
Returns
Promise<Record<string, TokenResponse>>
A promise that resolves to the AAD tokens.
getSignInResource(string, string, ConversationReference, ConversationReference)
Gets the sign-in resource.
function getSignInResource(msAppId: string, connectionName: string, conversation: ConversationReference, relatesTo?: ConversationReference): Promise<SignInResource>
Parameters
- msAppId
-
string
The application ID.
- connectionName
-
string
The connection name.
- conversation
- ConversationReference
- relatesTo
- ConversationReference
Returns
Promise<SignInResource>
A promise that resolves to the signing resource.
getTokenOrSignInResource(string, string, string, ConversationReference, ConversationReference, string, string, string)
Gets the token or sign-in resource.
function getTokenOrSignInResource(userId: string, connectionName: string, channelId: string, conversation: ConversationReference, relatesTo: ConversationReference, code: string, finalRedirect?: string, fwdUrl?: string): Promise<TokenOrSinginResourceResponse>
Parameters
- userId
-
string
The user ID.
- connectionName
-
string
The connection name.
- channelId
-
string
The channel ID.
- conversation
- ConversationReference
The conversation reference.
- relatesTo
- ConversationReference
The related conversation reference.
- code
-
string
The code.
- finalRedirect
-
string
The final redirect URL.
- fwdUrl
-
string
The forward URL.
Returns
Promise<TokenOrSinginResourceResponse>
A promise that resolves to the token or sign-in resource response.
getTokenStatus(string, string, string)
Gets the token status.
function getTokenStatus(userId: string, channelId: string, include?: string): Promise<TokenStatus[]>
Parameters
- userId
-
string
The user ID.
- channelId
-
string
The channel ID.
- include
-
string
The optional include parameter.
Returns
Promise<TokenStatus[]>
A promise that resolves to the token status.
getUserToken(string, string, string, string)
Gets the user token.
function getUserToken(connectionName: string, channelId: string, userId: string, code?: string): Promise<TokenResponse>
Parameters
- connectionName
-
string
The connection name.
- channelId
-
string
The channel ID.
- userId
-
string
The user ID.
- code
-
string
The optional code.
Returns
Promise<TokenResponse>
A promise that resolves to the user token.
signOut(string, string, string)
Signs the user out.
function signOut(userId: string, connectionName: string, channelId: string): Promise<void>
Parameters
- userId
-
string
The user ID.
- connectionName
-
string
The connection name.
- channelId
-
string
The channel ID.
Returns
Promise<void>
A promise that resolves when the sign-out operation is complete.
updateAuthToken(string)
function updateAuthToken(token: string)
Parameters
- token
-
string