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.
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
instead of this code
new Oidc.UserManager(stsSettings).removeUser();
I have tried newOidc.UserManager(stsSettings).signinRedirectCallback();
andnew Oidc.UserManager(stsSettings).signoutRedirectCallback();
but nothing is working.Please help me to achieve this.