keycloakify / oidc-spa

Openid connect client for Single Page Applications
https://www.oidc-spa.dev
MIT License
48 stars 6 forks source link

Stuck in fallback component : restore_from_http_only_cookie #6

Closed laurentC35 closed 9 months ago

laurentC35 commented 10 months ago

Hello,

Sometimes we get stuck in the fallback component in the application when this error occurs:

SSO silent login timeout with clientId : xxxxx

It occurs sometimes when we connect from another application on the same realm, which redirects us to our application.

It happens here in the code :

 restore_from_http_only_cookie: {
            const dLoginSuccessUrl = new Deferred<string | undefined>();

            const timeout = setTimeout(
                () =>
                    dLoginSuccessUrl.reject(
                        new Error(`SSO silent login timeout with clientId: ${clientId}`)
                    ),
                5000
            );

It is possible an cross domain error ? (cannot share cookie ?), I'm not sure

Is it possible to pass an ErrorComponent when an Error occurs, so each client of your library can choose how to manage the error.

NB: when this error occurs, a simple reload of the app fix the problem for user.

Thanks for regarding

Using : oidc-spa@2.0.3

garronej commented 10 months ago

Thanks for reporting @laurentC35,
I'll investigate with @ddecrulle

garronej commented 9 months ago

I think it would be resolved by https://github.com/garronej/oidc-spa/commit/25ec1be64f5cbf7a34b16653a494c7476d56250e

Please reopen if it isn't the case.

Thanks for reporting