Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading comment about silent redirect url #179

Open
linasburneika opened this issue Jun 6, 2023 · 1 comment
Open

Misleading comment about silent redirect url #179

linasburneika opened this issue Jun 6, 2023 · 1 comment
Assignees

Comments

@linasburneika
Copy link

linasburneika commented Jun 6, 2023

Comment tells that if silent redirect url is not configured, then the primary redirect url is reused and automatic silent renew will work:

/** The redirect URL used for silent sign in and renew. If not provided, will default to redirectUri. */

In reality however usermanager expects silentRedirectUri to be provided:

silent_redirect_uri: basicSettings.silentRedirectUri

without that access token obtained via interactive sign-in will get you 1 hour of work and then will fail abruptly.

Configuration of userManager allows 2 different redirect urls (interactive vs silent) for a reason. In case of silent signin, handling of response is done in a hidden iframe, where you want to load a minimal amount of code just to do processing. Official oidc-client sample even suggests to use a static html page for that:

https://github.com/authts/oidc-client-ts/blob/main/samples/Parcel/src/user-manager/sample-silent.html

If you reuse primary redirect uri also for silent signin, then it will load your complete app in the iframe. In case of itwin-viewer based app this is megabytes of javascript, which will hurt your RAM usage.

However if you don't configure silentRedirectUri, there is no way to know your configuration is not valid.
The underlying oidc-client needs it strictly:

https://github.com/authts/oidc-client-ts/blob/73c4ba86b13fa34d0ac33204a0dad998334e8a20/src/UserManager.ts#LL271C34-L271C34

But auth-client wrapper swallows the error:

@ben-polinsky ben-polinsky self-assigned this Jun 6, 2023
@ben-polinsky
Copy link
Collaborator

@ben-polinsky reminder to get this done this week. We've had another user confused by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants