IPublicClientApplication interface
Interface for the PublicClientApplication class defining the public API signatures
Methods
acquire |
Acquires a token by exchanging the authorization code received from the first step of OAuth 2.0 Authorization Code Flow |
acquire |
Acquires a token from the authority using OAuth2.0 device code flow |
acquire |
Acquires a token by exchanging the refresh token provided for a new set of tokens |
acquire |
Acquires tokens with password grant by exchanging client applications username and password for credentials |
acquire |
Acquires a token interactively |
acquire |
Acquires a token silently when a user specifies the account the token is requested for |
clear |
Clear the cache |
get |
Creates the URL of the authorization request |
get |
Returns the logger instance |
get |
Gets the token cache for the application |
set |
Replaces the default logger set in configurations with new Logger with new configurations |
Method Details
acquireTokenByCode(AuthorizationCodeRequest)
Acquires a token by exchanging the authorization code received from the first step of OAuth 2.0 Authorization Code Flow
function acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>
Parameters
- request
- AuthorizationCodeRequest
Returns
Promise<AuthenticationResult>
acquireTokenByDeviceCode(DeviceCodeRequest)
Acquires a token from the authority using OAuth2.0 device code flow
function acquireTokenByDeviceCode(request: DeviceCodeRequest): Promise<AuthenticationResult | null>
Parameters
- request
- DeviceCodeRequest
Returns
Promise<AuthenticationResult | null>
acquireTokenByRefreshToken(RefreshTokenRequest)
Acquires a token by exchanging the refresh token provided for a new set of tokens
function acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>
Parameters
- request
- RefreshTokenRequest
Returns
Promise<AuthenticationResult | null>
acquireTokenByUsernamePassword(UsernamePasswordRequest)
Acquires tokens with password grant by exchanging client applications username and password for credentials
function acquireTokenByUsernamePassword(request: UsernamePasswordRequest): Promise<AuthenticationResult | null>
Parameters
- request
- UsernamePasswordRequest
Returns
Promise<AuthenticationResult | null>
acquireTokenInteractive(InteractiveRequest)
Acquires a token interactively
function acquireTokenInteractive(request: InteractiveRequest): Promise<AuthenticationResult>
Parameters
- request
- InteractiveRequest
Returns
Promise<AuthenticationResult>
acquireTokenSilent(SilentFlowRequest)
Acquires a token silently when a user specifies the account the token is requested for
function acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult | null>
Parameters
- request
- SilentFlowRequest
Returns
Promise<AuthenticationResult | null>
clearCache()
Clear the cache
function clearCache()
getAuthCodeUrl(AuthorizationUrlRequest)
Creates the URL of the authorization request
function getAuthCodeUrl(request: AuthorizationUrlRequest): Promise<string>
Parameters
- request
- AuthorizationUrlRequest
Returns
Promise<string>
getLogger()
Returns the logger instance
function getLogger(): Logger
Returns
Logger
getTokenCache()
setLogger(Logger)
Replaces the default logger set in configurations with new Logger with new configurations
function setLogger(logger: Logger)
Parameters
- logger
-
Logger