mrochon / b2csamples

MIT License
132 stars 41 forks source link

Invitation link expiry error message #7

Closed kiranbhadani closed 4 years ago

kiranbhadani commented 4 years ago

I have setup azure b2c custom policy for inivation flow, using this sample, it's working fine, but when the invitation link gets expired, and user opens that it shows error page with

"AADB2C90017: The client assertion provided in the request is invalid: 'client_secret' was used as the verification key"

I want to change the error message so user can know that link is expired.

mrochon commented 4 years ago

You have a number of options. Probably the easiest will be to provide a custom page to display errors (the one refere3nced by "api.error"), use js in it to detect this specific error and display your own message. You may want to modify the flow altogether and have the invite go first to your app with the token, check it there for validity and only then redirect the user to B2C. lastly, you can change the validity length of the token (it's a setting in the REST function's appSettings.json file).