How to use the angular-auth-oidc-client.AuthorizationState.unauthorized function in angular-auth-oidc-client

To help you get started, we’ve selected a few angular-auth-oidc-client 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 lydemann / oidc-angular-identityserver / Solution 6 - OIDC and Angular client / ClientApp / ClientApp / src / app / core / auth / auth.service.ts View on Github external
private onAuthorizationResultComplete(authorizationResult: AuthorizationResult) {

        console.log('Auth result received AuthorizationState:'
            + authorizationResult.authorizationState
            + ' validationResult:' + authorizationResult.validationResult);

        if (authorizationResult.authorizationState === AuthorizationState.unauthorized) {
            if (window.parent) {
                // sent from the child iframe, for example the silent renew
                this.router.navigate(['/unauthorized']);
            } else {
                window.location.href = '/unauthorized';
            }
        }
    }