-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1964 from AzureAD/add-silent-request
[msal-browser] Add SilentRequest.ts
- Loading branch information
Showing
9 changed files
with
86 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import { AuthenticationResult, AuthorizationUrlRequest } from "@azure/msal-common"; | ||
import { SilentFlowRequest, EndSessionRequest, AccountInfo } from "../"; | ||
import { AuthenticationResult, AuthorizationUrlRequest, SilentFlowRequest, AccountInfo, EndSessionRequest } from "@azure/msal-common"; | ||
import { RedirectRequest } from "../request/RedirectRequest"; | ||
import { PopupRequest } from "../request/PopupRequest"; | ||
import { SilentRequest } from "../request/SilentRequest"; | ||
|
||
/* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
export interface IPublicClientApplication { | ||
acquireTokenPopup(request: AuthorizationUrlRequest): Promise<AuthenticationResult>; | ||
acquireTokenRedirect(request: AuthorizationUrlRequest): Promise<void>; | ||
acquireTokenSilent(silentRequest: SilentFlowRequest): Promise<AuthenticationResult>; | ||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>; | ||
acquireTokenRedirect(request: RedirectRequest): Promise<void>; | ||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>; | ||
getAccountByUsername(userName: string): AccountInfo; | ||
getAllAccounts(): AccountInfo[]; | ||
handleRedirectPromise(): Promise<AuthenticationResult | null>; | ||
loginPopup(request: AuthorizationUrlRequest): Promise<AuthenticationResult>; | ||
loginRedirect(request: AuthorizationUrlRequest): Promise<void>; | ||
loginPopup(request: PopupRequest): Promise<AuthenticationResult>; | ||
loginRedirect(request: RedirectRequest): Promise<void>; | ||
logout(logoutRequest?: EndSessionRequest): Promise<void>; | ||
ssoSilent(request: AuthorizationUrlRequest): Promise<AuthenticationResult>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
import { SilentFlowRequest } from "@azure/msal-common"; | ||
|
||
/** | ||
* @type SilentRequest: Request object passed by user to retrieve tokens from the | ||
* cache, renew an expired token with a refresh token, or retrieve a code (first leg of authorization code grant flow) | ||
* in a hidden iframe. | ||
* | ||
* - scopes - Array of scopes the application is requesting access to. | ||
* - authority - Url of the authority which the application acquires tokens from. | ||
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes. | ||
* - account - Account entity to lookup the credentials. | ||
* - forceRefresh - Forces silent requests to make network calls if true. | ||
* - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal. | ||
*/ | ||
export type SilentRequest = SilentFlowRequest & { | ||
redirectUri?: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters