You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using yew_oauth2 in a scenario where the user may be able to select a login realm. A simple example of this using keycloak would be similar to the example below. This does not appear to be the correct way to do this due to the error that occurs when the 2nd realm is selected.
In this scenario:
load page
change realm to "Realm Two"
Click Login
at this point the redirect to KeyCloak with the correct realm is selected for authentication, however, once authentication is complete, we see that exchange code fails
login result: failed to exchange code: Server returned error response
and in the console log output in the browser a message similar to:
POST http://localhost:8084/realms/realm_one/protocol/openid-connect/token [HTTP/1.1 400 Bad Request ...]
the interesting thing here is that while part of the configuration has correctly been updated and the authentication request has been directed to the correct realm, the subsequent post for code exchange appears to be directed to the realm initially configured. I spent some time reviewing the config change code in the OpenID Client but was not able to determine whether this is an issue in the library, not the correct way to change configuration, or something else.
Hm, I not sure it's been tried before. But I'd expect it to work too.
It might be that the config doesn't get passed to the agent that is being created in the background. The config would be received by the OAut2 component as a change. But then might not get passed on to the agent.
I'm coming to this issue from an angle of needing multiple OpenID authentications active at the same time (I'll elaborate on the actual use case if there's interest, but for sake of simplicity say a PWA should act on GitHub and GitLab issues at the same time).
Thinking about changing OAuth2 configurations in terms of "I'm removing an instance of the agent from the pool and adding a different one" may be an easier (or trivial if multiple providers are tackled first) approach than mutating something that was originally designed assuming that it will not be mutated.
I am not sure it easily possible at the moment. It's using the yew contexts. So that means that only one context (the closest one) would be found by child components. You'd need to somehow work around this, aggregating multiple tokens into your own context.
We are using yew_oauth2 in a scenario where the user may be able to select a login realm. A simple example of this using keycloak would be similar to the example below. This does not appear to be the correct way to do this due to the error that occurs when the 2nd realm is selected.
In this scenario:
at this point the redirect to KeyCloak with the correct realm is selected for authentication, however, once authentication is complete, we see that exchange code fails
login result: failed to exchange code: Server returned error response
and in the console log output in the browser a message similar to:
POST http://localhost:8084/realms/realm_one/protocol/openid-connect/token [HTTP/1.1 400 Bad Request ...]
the interesting thing here is that while part of the configuration has correctly been updated and the authentication request has been directed to the correct realm, the subsequent post for code exchange appears to be directed to the realm initially configured. I spent some time reviewing the config change code in the OpenID Client but was not able to determine whether this is an issue in the library, not the correct way to change configuration, or something else.
The text was updated successfully, but these errors were encountered: