-
Notifications
You must be signed in to change notification settings - Fork 115
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
Bug: ERR_STATES_NOT_MATCH when web app is hosted at same server #94
Comments
@moberwasserlechner - this has nothing to do with IdentityServer (you added the label). I'm experiencing the same issue with our local openid endpoint and this is due to what @klot-git describes: app and openid are hosted on the same endpoint. He also provides a suggestion for a fix:
|
@klot-git I just tried your suggested fix but that doesn't seem to resolve it in my case. |
I applied @klot-git solution to the web impl. Thx for that. |
Hey @ropstah, Have you been able to resolve that issue ? I am having the same problem and @klot-git's change didnt work for me either. |
Capacitor version:
Run
npx cap doctor
:Capacitor Doctor
Latest Dependencies:
@capacitor/cli: 2.1.0
@capacitor/core: 2.1.0
@capacitor/android: 2.1.0
@capacitor/electron: 2.1.0
@capacitor/ios: 2.1.0
Installed Dependencies:
@capacitor/electron not installed
@capacitor/cli 2.1.0
@capacitor/core 2.1.0
@capacitor/android 2.1.0
@capacitor/ios 2.0.1
[success] Android looking great! �👌
[error] Xcode is not installed
Library version:
OAuth Provider:
Server is hosted at: https://nomina-med.azurewebsites.net
Your Plugin Configuration
Affected Platform(s):
Current Behavior
The Identity Server and the Ionic Web application is hosted at the same server:
https://nomina-med.azurewebsites.net (server)
https://nomina-med.azurewebsites.net/app (ionic app)
When the user tries to sign in, the ionic app opens the new window to authenticate but immediately closes it, it with the following error: OAuth rejected Error: ERR_STATES_NOT_MATCH
When the ionic app and the Identity Server is hosted at different servers, everything works fine (ex: localhost:5000 and localhost:8100).
Expected Behavior
When the user tries to sign in, the ionic app should open the new window
, the Identity Server will provide the authentication options, the user will provide his credentials, and only then, the window should be closed.
Other Information
The library seems to expect that the Authentication provider is hosted at a different server, and relays on the "DOMException: Blocked a frame..." to wait to close the authentication window.
When hosted at the same server, the exception is never throwed and it closes the window before the user provide his credentials.
I believe changing the line 67 of the web.ts would solve the issue:
if (href != null && href.indexOf(this.webOptions.redirectUrl) >= 0) {
The text was updated successfully, but these errors were encountered: