IdentityModel / oidc-client-js

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
Apache License 2.0
2.43k stars 842 forks source link

Manually set URL state #1328

Closed lacroixdavid1 closed 3 years ago

lacroixdavid1 commented 3 years ago

Is there a way when redirecting to the Sign-in URL to manually set the URL state query param?

brockallen commented 3 years ago

No, but there's a way to preserve state across the round trip. You set the state value on the args to the signinXxx methods.

brockallen commented 3 years ago

For example:

https://github.com/IdentityModel/oidc-client-js/blob/dev/samples/VanillaJS/public/code-identityserver-sample.js#L135

and then this will have the state on the response:

https://github.com/IdentityModel/oidc-client-js/blob/dev/samples/VanillaJS/public/code-identityserver-sample-callback.js#L4

lacroixdavid1 commented 3 years ago

I need to have absolute control over what the state query param will be. It matters for our Identity Server. Is there any way to have control on that?

brockallen commented 3 years ago

I need to have absolute control over what the state query param will be. It matters for our Identity Server.

Unfortunate, as it's supposed to be opaque to the STS

Is there any way to have control on that?

Nope, sorry.

lacroixdavid1 commented 3 years ago

Closing. I'll be using extraQueryParams and adjust the Identity server.