TeamsUserCredential class

Represent Teams current user's identity, and it is used within Teams client applications.

Remarks

Can only be used within Teams.

Constructors

TeamsUserCredential(AuthenticationConfiguration)
TeamsUserCredential(TeamsUserCredentialAuthConfig)

Constructor of TeamsUserCredential.

Methods

getToken(string | string[], GetTokenOptions)

Get access token from credential.

getUserInfo(string[])

Get basic user info from SSO token

login(string | string[], string[])

Popup login page to get user's access token with specific scopes.

Constructor Details

TeamsUserCredential(AuthenticationConfiguration)

new TeamsUserCredential(authConfig: AuthenticationConfiguration)

Parameters

TeamsUserCredential(TeamsUserCredentialAuthConfig)

Constructor of TeamsUserCredential.

new TeamsUserCredential(authConfig: TeamsUserCredentialAuthConfig)

Parameters

Remarks

Can only be used within Teams.

Method Details

getToken(string | string[], GetTokenOptions)

Get access token from credential.

function getToken(scopes: string | string[], options?: GetTokenOptions): Promise<null | AccessToken>

Parameters

scopes

string | string[]

options
GetTokenOptions

Returns

Promise<null | AccessToken>

Remarks

Can only be used within Teams.

getUserInfo(string[])

Get basic user info from SSO token

function getUserInfo(resources?: string[]): Promise<UserInfo>

Parameters

resources

string[]

The optional list of resources for full trust Teams apps.

Returns

Promise<UserInfo>

Remarks

Can only be used within Teams.

login(string | string[], string[])

Popup login page to get user's access token with specific scopes.

function login(scopes: string | string[], resources?: string[]): Promise<void>

Parameters

scopes

string | string[]

resources

string[]

The optional list of resources for full trust Teams apps.

Returns

Promise<void>

Remarks

Can only be used within Teams.