How to use the msal.Constants.loginRequest function in msal

To help you get started, we’ve selected a few msal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AzureAD / microsoft-authentication-library-for-js / lib / msal-angular / dist / msal.service.js View on Github external
}
                }
                if (callback && typeof callback === "function") {
                    callback(errorDescription, token, error, tokenType);
                }
                // since this is a token renewal request in iFrame, we don't need to proceed with the location change.
                if (window.parent !== window) { //in iframe
                    if (event && event.preventDefault) {
                        event.preventDefault();
                    }
                    return;
                }
                // redirect to login start page
                if (window.parent === window && !isPopup) {
                    if (this._navigateToLoginRequestUrl) {
                        var loginStartPage = this._cacheStorage.getItem(Constants.loginRequest);
                        this._cacheStorage.setItem(Constants.urlHash, hash);
                        if (typeof loginStartPage !== "undefined" && loginStartPage && loginStartPage.length !== 0) {
                            // prevent the current location change and redirect the user back to the login start page
                            this._logger.verbose("Redirecting to start page: " + loginStartPage);
                            window.location.href = loginStartPage;
                        }
                    }
                    //redirect to redirect uri. No page reload here since we are only removing the url after the hash
                    else {
                        window.location.hash = '';
                    }
                }
            }
            else {
                // state did not match, broadcast an error
                this.broadcastService.broadcast("msal:stateMismatch", msalError);
github AzureAD / microsoft-authentication-library-for-js / lib / msal-angular / src / msal.service.ts View on Github external
public acquireTokenRedirect(scopes: Array, authority?: string, user?: User, extraQueryParameters?: string) {
        var acquireTokenStartPage = this._cacheStorage.getItem(Constants.loginRequest);
        if (window.location.href !== acquireTokenStartPage)
            this._cacheStorage.setItem(Constants.loginRequest, window.location.href);
        super.acquireTokenRedirect(scopes, authority, user, extraQueryParameters);
    }
github AzureAD / microsoft-authentication-library-for-js / lib / msal-angular / dist / msal.service.js View on Github external
acquireTokenRedirect(scopes, authority, user, extraQueryParameters) {
        var acquireTokenStartPage = this._cacheStorage.getItem(Constants.loginRequest);
        if (window.location.href !== acquireTokenStartPage)
            this._cacheStorage.setItem(Constants.loginRequest, window.location.href);
        super.acquireTokenRedirect(scopes, authority, user, extraQueryParameters);
    }
    loginInProgress() {
github AzureAD / microsoft-authentication-library-for-js / lib / msal-angular / src / msal.service.ts View on Github external
public acquireTokenRedirect(scopes: Array, authority?: string, user?: User, extraQueryParameters?: string) {
        var acquireTokenStartPage = this._cacheStorage.getItem(Constants.loginRequest);
        if (window.location.href !== acquireTokenStartPage)
            this._cacheStorage.setItem(Constants.loginRequest, window.location.href);
        super.acquireTokenRedirect(scopes, authority, user, extraQueryParameters);
    }