Oidc-client-js: Allow a single signinRedirect url and api to process signin results

Created on 20 Dec 2017  路  5Comments  路  Source: IdentityModel/oidc-client-js

Hi,
Is there a way to have a single redirect_uri woking both for silent & non-silent signin ?
Is there any value in the localStorage to identify the signin mode?

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>redirect</title>
</head>
<body>
    <script src="oidc-client.js"></script>
    <script>
  var userManager = new Oidc.UserManager();
  if (userManager.isSilentSignin) {
    userManager.signinSilentCallback();
  } else {
    userManager.signinRedirectCallback();
  }
    </script>
</body>
</html>
enhancement

Most helpful comment

Not a bad idea. It'd be a breaking change, but seems worthwhile.

All 5 comments

No because they process the response differently.

Is it acceptable to store within the localStorage the sign-in mode before proceeding, then retrieving the mode before calling the callback?
Is there any issue with it?

Not a bad idea. It'd be a breaking change, but seems worthwhile.

Yep, added a single API to handle signin redirects

477

Was this page helpful?
0 / 5 - 0 ratings