fa-fifi / keycloak_wrapper

Keycloak Single Sign-On (SSO) authentication package for Flutter framework.
https://pub.dev/packages/keycloak_wrapper
BSD 3-Clause "New" or "Revised" License
12 stars 11 forks source link

On keycloak redirect back after succes login app crashes #48

Closed jaderdev closed 3 weeks ago

jaderdev commented 1 month ago

Captura de Tela 2024-10-24 às 03 56 59

My keycloak

Captura de Tela 2024-10-24 às 03 57 30

The error I get after a successful login!

Captura de Tela 2024-10-24 às 03 58 27

My build gradle

Im using the example aplication and my keycloak its working well! But when it redirects to the app i receive this error!

Could you help me?

Captura de Tela 2024-10-24 às 03 59 47

My config

fa-fifi commented 1 month ago

Hi, there.

I'm just saying that I'm quite busy this week. So, I'll look at this issue again later. Maybe tomorrow or the day after. I'm so sorry for the inconvenience. But in case you have resolved the issue, maybe you can share your findings here.

My only suggestion for now is maybe you can downgrade the package version to see whether the problem only occurs for the latest version or not. Hope that helps.

jaderdev commented 1 month ago

OK man, I still not solved the problem! But ill try downgrade and try again, thanks!

jaderdev commented 1 month ago

Man, one more question. Did you had success redirecting from keycloak right to the app?

fa-fifi commented 1 month ago

Yup, most of the time and my company also using this package in production.

I afraid this issue might only happens on the latest version due to dependecies update. However, please read through the documentation thoroughly so you won't miss any important details.

jaderdev commented 1 month ago

Which is the version you are using in your Company? Do you know the keycloak version? The problem im having is inside android where the keycloak redirect uses http not https and Android guess its insecure!

fa-fifi commented 1 month ago

If you are using http, you have to allow insecure http connection on your android app. Have you checked out this guide?

jaderdev commented 1 month ago

The question is that Im not running http, im running https but it is changing to http!

fa-fifi commented 1 month ago

Mmm... I've tried using the example app and it is working fine logging to my keycloak server.

I don't think your issue is a configuration issue, but maybe your keycloak server is behind a firewall that your emulator can't reach. Or you have to double check your input value or something. I'm also not sure, but the last thing I can do to help you is thru a video call.

jaderdev commented 1 month ago

Man, you're a great guy! Thanks for be so willing to help. Maybe we can make a video call and solve this. How is your schedule?

fa-fifi commented 1 month ago

Add me on Linkedin and we'll discuss there.

ecolque commented 4 weeks ago

I have same problem, on keycloakc redirect back after success login app not receive the code. i review my keycloack credential it is ok.

Screenshot 2024-11-06 at 14 13 10

click in the first icon the message: login failed

Screenshot_2024-11-06-14-10-37-731-edit_com android chrome click in the second icon the message: No stored state - unable to handle response and the button sign in set disable

fa-fifi commented 4 weeks ago

@ecolque Remove android:taskAffinity="" from your AndroidManifest.xml file.