Share via


AuthManager class

Authenticates users to Azure AD and obtains tokens for API requests.

Constructors

AuthManager(AuthOptions)

Methods

finalizeLogin()

Should be called each time the page requiring auth loads. May result in additional redirects. After any such redirects, this method should be called again.

login()

Logs the user into Azure AD via redirect. Should be called in response to a click on a login button or equivalent action in the web app.

logout()

Logs the user out of Azure AD via redirect.

Constructor Details

AuthManager(AuthOptions)

new AuthManager(opts: AuthOptions)

Parameters

Method Details

finalizeLogin()

Should be called each time the page requiring auth loads. May result in additional redirects. After any such redirects, this method should be called again.

function finalizeLogin(): Promise<LoginResult>

Returns

Promise<LoginResult>

a Promise resolving with the login result or rejecting with an error if one occurred.

login()

Logs the user into Azure AD via redirect. Should be called in response to a click on a login button or equivalent action in the web app.

function login()

logout()

Logs the user out of Azure AD via redirect.

function logout()