Bdaya-Dev / oidc

Flutter OpenIdConnect plugin
https://bdaya-dev.github.io/oidc/
MIT License
28 stars 15 forks source link

fix: Wrong message "Operation Successful! Please close this page." in case of reading token failed (CORS) #116

Open s681562 opened 2 months ago

s681562 commented 2 months ago

Description

The redirect page shows Operation Successful! Please close this page. But the token is not read because of CORS error.

Steps To Reproduce

  1. If Keycloak login popup appears, login.
  2. After login redirect.html is called
  3. "Operation Successful! Please close this page." is printed in open window
  4. The open window get not closen
  5. If you close this open window and go back to your app, no token is fetched

Expected Behavior

Normally the new open window (redirect.html) will be closed automatically. You are back to your application and token is fetched and you got all user info from Keycloak.

In case of this error I hope to get an detailed error message in redirect.html or from OidcUserManager.

Screenshots

image

ahmednfwela commented 2 months ago

Hi @s681562 please check out the keycloak weborigins config

https://stackoverflow.com/questions/59018604/keycloak-no-access-control-allow-origin-header-is-present-on-the-requested-r