Skip to content
This repository was archived by the owner on Mar 3, 2022. It is now read-only.

Help needed on , STS logout then silent renew force to sign in #1388

@ebinroy

Description

@ebinroy

Hi All,
if STS user has logout then silent renew will be called. In silent renew I will get the query string error="login_required". I tried to the below code but I would like to redirect to the STS login again

function getParameterByName(name, url = window.location.href) {
name = name.replace(/[\[\]]/g, '\\$&');
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}

//same as the auth config settings
const stsSettings = {
authority: "https://localhost:5000/",
client_id: "AngularClient",
scope: "openid profile api1",
response_type: "code",

redirect_uri: "http://localhost:4200/signin-callback",
};

var errParam = getParameterByName('error');
console.log("errParam ====> ", errParam);

//STS user logout then remove the User
if (errParam == "login_required"){
//redirect the user to STS for sign-in????????
new Oidc.UserManager(stsSettings).removeUser();
}
else{
new Oidc.UserManager(stsSettings).signinSilentCallback();
}

instead of this code new Oidc.UserManager(stsSettings).removeUser(); I have tried new Oidc.UserManager(stsSettings).signinRedirectCallback(); and new Oidc.UserManager(stsSettings).signoutRedirectCallback(); but nothing is working.

Please help me to achieve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions