-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Hey,
In NodeJS there is the possibility for an application to request a refresh token that can be stored on the server. I am developing a hybrid mobile application that will run in a secure context and I use the browser authentication to do so.
Everything works fine, I have a clientId: https://sembeacon.org/id.jsonld that could request a refresh_token, etc...
However, I want to disable the silent login that redirects the user away to the Authorization server whenever they reopen the app,
since other than a browser - this is a much more visible process in a mobile application. I already have my insecure and secure storage configured for localStorage - but this does not seem to work.
From what I see, the client authentication uses the following authentication flow: https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth while the node implementation has a refresh token flow. There does not seem to be a possibility to change this flow since the login flow is defined in:
solid-client-authn-js/packages/browser/src/dependencies.ts
Lines 81 to 86 in 4902d20
| const loginHandler = new OidcLoginHandler( | |
| storageUtility, | |
| new AuthorizationCodeWithPkceOidcHandler(storageUtility, redirector), | |
| issuerConfigFetcher, | |
| clientRegistrar, | |
| ); |
which can not be changed or configured before it is loaded by a session.
Is it possible to somehow to either:
- Request a refresh token in the browser
- Retrieve and reuse the id_token and access_token to restore the session when the access token has not expired yet?
- My next attempt will be to override the
clientAuthenticationobject in each session, to replace the login flow with something that has theRefreshTokenOidcHandlerin anAggregateOidcHandler. However, I do not know if this will work and it also feels like a solution for an issue that should not be there. A configuration to use refresh tokens would be useful or at least a solution to persist the access token and id_token for page refresh.
Best,
Maxim