PopupClient class
- Extends
Constructors
Popup |
Methods
acquire |
Acquires tokens by opening a popup window to the /authorize endpoint of the authority |
clean |
Closes popup, removes any state vars created during popup calls. |
generate |
Generates the name for the popup based on the client id and request for logouts |
generate |
Generates the name for the popup based on the client id and request |
initiate |
Opens a popup window with given request Url. |
logout(End |
Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server |
monitor |
Monitors a window until it loads a url with the same origin. |
open |
Helper function to set popup window dimensions and position |
unload |
Event callback to unload main window. |
wait |
Waits for user interaction in logout popup window |
Inherited Methods
get |
Use to get the redirect uri configured in MSAL or null. |
Constructor Details
PopupClient(BrowserConfiguration, BrowserCacheManager, ICrypto, Logger, EventHandler, INavigationClient, IPerformanceClient, BrowserCacheManager, NativeMessageHandler, string)
new PopupClient(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string)
Parameters
- config
- BrowserConfiguration
- storageImpl
- BrowserCacheManager
- browserCrypto
-
ICrypto
- logger
-
Logger
- eventHandler
- EventHandler
- navigationClient
- INavigationClient
- performanceClient
-
IPerformanceClient
- nativeStorageImpl
- BrowserCacheManager
- nativeMessageHandler
- NativeMessageHandler
- correlationId
-
string
Method Details
acquireToken(PopupRequest)
Acquires tokens by opening a popup window to the /authorize endpoint of the authority
function acquireToken(request: PopupRequest): Promise<AuthenticationResult>
Parameters
- request
- PopupRequest
Returns
Promise<AuthenticationResult>
cleanPopup(Window)
Closes popup, removes any state vars created during popup calls.
function cleanPopup(popupWindow?: Window)
Parameters
- popupWindow
-
Window
generateLogoutPopupName(CommonEndSessionRequest)
Generates the name for the popup based on the client id and request for logouts
function generateLogoutPopupName(request: CommonEndSessionRequest): string
Parameters
- request
-
CommonEndSessionRequest
Returns
string
generatePopupName(Array<string>, string)
Generates the name for the popup based on the client id and request
function generatePopupName(scopes: Array<string>, authority: string): string
Parameters
- scopes
-
Array<string>
- authority
-
string
Returns
string
initiateAuthRequest(string, PopupParams)
Opens a popup window with given request Url.
function initiateAuthRequest(requestUrl: string, params: PopupParams): Window
Parameters
- requestUrl
-
string
- params
- PopupParams
Returns
Window
logout(EndSessionPopupRequest)
Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
function logout(logoutRequest?: EndSessionPopupRequest): Promise<void>
Parameters
- logoutRequest
- EndSessionPopupRequest
Returns
Promise<void>
monitorPopupForHash(Window)
Monitors a window until it loads a url with the same origin.
function monitorPopupForHash(popupWindow: Window): Promise<string>
Parameters
- popupWindow
-
Window
window that is being monitored
Returns
Promise<string>
openSizedPopup(string, string, PopupWindowAttributes)
Helper function to set popup window dimensions and position
function openSizedPopup(urlNavigate: string, popupName: string, popupWindowAttributes: PopupWindowAttributes): Window | null
Parameters
- urlNavigate
-
string
- popupName
-
string
- popupWindowAttributes
- PopupWindowAttributes
Returns
Window | null
unloadWindow(Event)
Event callback to unload main window.
function unloadWindow(e: Event)
Parameters
- e
-
Event
waitForLogoutPopup(Window)
Waits for user interaction in logout popup window
function waitForLogoutPopup(popupWindow: Window): Promise<void>
Parameters
- popupWindow
-
Window
Returns
Promise<void>
Inherited Method Details
getRedirectUri(string)
Use to get the redirect uri configured in MSAL or null.
function getRedirectUri(requestRedirectUri?: string): string
Parameters
- requestRedirectUri
-
string
Returns
string
Redirect URL
Inherited From BaseInteractionClient.getRedirectUri