BrowserUtils module
Functions
| add |
|
| block |
Block redirectUri loaded in popup from calling AcquireToken APIs |
| block |
Throws error if initialize hasn't been called |
| block |
Throws error if token requests are made in non-browser environment |
| block |
Block redirect operations in iframes unless explicitly allowed |
| block |
Throws error if we have completed an auth and are attempting another auth request inside an iframe. |
| clear |
Clears hash from window url. |
| create |
Wrapper function that creates a UUID v7 from the current timestamp. |
| get |
Returns current window URL as redirect uri |
| get |
Gets the homepage url for the current window location. |
| is |
Returns boolean of whether the current window is in an iframe or not. |
| is |
Returns boolean of whether or not the current window is a popup opened by msal |
| preconnect(string) | Adds a preconnect link element to the header which begins DNS resolution and SSL connection in anticipation of the /token request |
| preflight |
Helper to validate app environment before making an auth request |
| redirect |
Helper to validate app enviornment before making redirect request |
| replace |
Replaces current hash with hash from provided url |
Function Details
addClientCapabilitiesToClaims(string, string[])
function addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: string[]): string
Parameters
- claims
-
string
- clientCapabilities
-
string[]
Returns
string
blockAcquireTokenInPopups()
Block redirectUri loaded in popup from calling AcquireToken APIs
function blockAcquireTokenInPopups()
blockAPICallsBeforeInitialize(boolean)
Throws error if initialize hasn't been called
function blockAPICallsBeforeInitialize(initialized: boolean)
Parameters
- initialized
-
boolean
blockNonBrowserEnvironment()
Throws error if token requests are made in non-browser environment
function blockNonBrowserEnvironment()
blockRedirectInIframe(boolean)
Block redirect operations in iframes unless explicitly allowed
function blockRedirectInIframe(allowRedirectInIframe: boolean)
Parameters
- allowRedirectInIframe
-
boolean
Config value to allow redirects when app is inside an iframe
blockReloadInHiddenIframes()
Throws error if we have completed an auth and are attempting another auth request inside an iframe.
function blockReloadInHiddenIframes()
clearHash(Window)
Clears hash from window url.
function clearHash(contentWindow: Window)
Parameters
- contentWindow
-
Window
createGuid()
Wrapper function that creates a UUID v7 from the current timestamp.
function createGuid(): string
Returns
string
getCurrentUri()
Returns current window URL as redirect uri
function getCurrentUri(): string
Returns
string
getHomepage()
Gets the homepage url for the current window location.
function getHomepage(): string
Returns
string
isInIframe()
Returns boolean of whether the current window is in an iframe or not.
function isInIframe(): boolean
Returns
boolean
isInPopup()
Returns boolean of whether or not the current window is a popup opened by msal
function isInPopup(): boolean
Returns
boolean
preconnect(string)
Adds a preconnect link element to the header which begins DNS resolution and SSL connection in anticipation of the /token request
function preconnect(authority: string)
Parameters
- authority
-
string
preflightCheck(boolean)
Helper to validate app environment before making an auth request
function preflightCheck(initialized: boolean)
Parameters
- initialized
-
boolean
redirectPreflightCheck(boolean, BrowserConfiguration)
Helper to validate app enviornment before making redirect request
function redirectPreflightCheck(initialized: boolean, config: BrowserConfiguration)
Parameters
- initialized
-
boolean
- config
-
BrowserConfiguration
replaceHash(string)
Replaces current hash with hash from provided url
function replaceHash(url: string)
Parameters
- url
-
string