0
votes

New users are on-boarded via an offline process. At the end they are directed to a custom policy that does a password reset. This allows the user to choose their own password.

This is essentially the standard custom password reset policy without the need to validate the email. The user name is passed via a signed JWT token.

This all works and a valid ID token is returned.

The problem is getting a refresh token when this token expires.

We haven't found a way to do this.

Setting an "offline_access" scope doesn't seem to do anything.

Trying the "silent refresh" approach (prompt = "none") returns an error message stating that you don't have a session.

The applications are SPA built around adal.js.

An example of the password reset message is:

https://login.microsoftonline.com/tenant.onmicrosoft.com/oauth2/v2.0/authorize ?p=B2C_1A_Custom-PasswordReset &client_id=xxx &redirect_uri=yyy &scope=openid%20offline_access&response_type=id_token &prompt=login &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=JWT

Anyone ever got this working?

1

1 Answers

1
votes

For a single-page application, a refresh token isn't issued, since this isn't considered to be secure.

Applications that use the implicit flow must implement a silent authentication to refresh tokens.

The silent authentication might be failing because your "Custom-PasswordReset" journey doesn't include the DefaultSSOSessionProvider SSO session provider to set the SSO claims in the user session.

As an example of this, see the LocalAccount-PasswordSet technical profile in the Wingtip sample, which is invoked to set the first-time password for a pre-verified user.