appsup-dart / openid_client

Library for working with OpenID Connect and implementing clients.
BSD 3-Clause "New" or "Revised" License
90 stars 118 forks source link

Not able to redirect to the application after successful login #51

Closed SameerChorge94 closed 1 year ago

SameerChorge94 commented 3 years ago

Hello,

I created the sample application as per your provided readme document, it's working properly for the mobile but facing some issues for the web

After running the project with the below command flutter run -d chrome --web-port 60000 it navigates to the keycloak login screen and after login it redirects to one white screen with url contains the information for the token state etc. and does not navigate back to the app.

As per noticed issue i'm facing this issue only when running through the above command or normal flutter project run. When i build the project and then host it in the IIS (Internet Service Manager ) in windows system, it seems to work fine i.e. it redirects to app after successful login.

Steps to reproduce:

  1. Create new flutter project
  2. import packages as per the readme example setup the whole example for web
  3. After running normally with command it redirects to the login screen but after successful login it stuck on white screen with token and some other details in the URL section

Versions:

Flutter 2.0.1 • channel beta • https://github.com/flutter/flutter.git
Framework • revision c5a4b4029c (7 months ago) • 2021-03-04 09:47:48 -0800
Engine • revision 40441def69
Tools • Dart 2.12.0

Any workaround or solution for this issue, As each time building app and after that hosting is not a feasible solution as sometimes we need to debug the project

Thank you.

NassB commented 2 years ago

Hi @SameerChorge94, did you manage to get the redirection to your application to work? I have the same problem.

SameerChorge94 commented 2 years ago

@NassB i used another package instead which worked for both web and the mobile https://github.com/Concerti-IO/openidconnect_flutter

NassB commented 2 years ago

@SameerChorge94 ok I will try it then. Thanks!

rbellens commented 1 year ago

This package does not contain the flutter specific code to open a browser and close it afterwards. There are some working examples on how it can be done on different platforms, including flutter, in the examples directory. Probably, you need to experiment with the url_launcher plugin or similar plugins.

csipetcsabi commented 1 year ago

Hi, I had the same issue. The problem was, I haven't use port in the redirect URL. After I changed it, the redirection worked fine.