Skip to content
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

PlatformException(authorize_and_exchange_code_failed, Failed to authorize: Connection error making token request to 'https://xxx/realms/AAA/protocol/openid-connect/token': The certificate for this server is invalid. You might be connecting to a server that is pretending to be 'xxx' which could put your confidential information at risk... #386

Open
tungtt1501 opened this issue Nov 7, 2022 · 4 comments

Comments

@tungtt1501
Copy link

Hi to Flutter app auth team.

I'm using the last version of flutter_appauth to connect with Keycloak server. Everything are working well, but I got an error when callback in IOS(it's working fine on Android).
PlatformException(authorize_and_exchange_code_failed, Failed to authorize: Connection error making token request to 'https://xxx/realms/AAA/protocol/openid-connect/token': The certificate for this server is invalid. You might be connecting to a server that is pretending to be 'xxx' which could put your confidential information at risk...

For iOS in info.plist:
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string><my_scheme></string> </array> </dict> </array>
Maybe it's problem from self-signed certificate. How could I solve this problem?

@Dahkenangnon
Copy link

Hi @tungtt1501

Is your server using HTTPs ?

I thank this can be as you mentioned, a self-signed certifcate issue.

Check this stack over flow answer: https://stackoverflow.com/a/61312927/12461921

@tungtt1501
Copy link
Author

Hi @Dahkenangnon
Yes, my server is using https. I've tried to apply the solution in https://stackoverflow.com/a/61312927/12461921 but it's not works. Another point to track: when I use the method "authorize" then it's working normal. I guess the problem come from the way implement of 2 methods. Any solution for this issue?

@Dahkenangnon
Copy link

@tungtt1501

Can you please edit the issue's title. I forgot to remember you to edit it. The title is so long to read and people won't probably open it to help resolve your issue.

To get more help, I suggest you to edit it like e.g: Failed to authorize: connection error making token request.

@MaikuB
Copy link
Owner

MaikuB commented Jan 14, 2023

You would need to do more research on if it's possible to resolve this. I don't have that level of knowledge to provide you an answer and one of the main reasons behind this is this plugin is a wrapper for native SDKs. You would need to look into seeing if those SDKs provide any means to get around the issue or if there's something else that iOS requires with your app's configuration

On a different note, should mention there isn't a team behind maintaining this particular plugin. I'm the sole maintainer of this plugin that in turn has received contributions by the community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants