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

Fix error in code #19

Closed
pyxiscloud opened this issue Nov 16, 2022 · 9 comments
Closed

Fix error in code #19

pyxiscloud opened this issue Nov 16, 2022 · 9 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@pyxiscloud
Copy link

pyxiscloud commented Nov 16, 2022

3 days trying to get auth working in flutter web.
It works after commenting this at castor.dart

Uri getSigninUrl({String scope = "read", String? state}) {

    return Uri.https(config.endpoint, "login/oauth/authorize", {

      "client_id": config.clientId,

      "response_type": "code",

      "scope": scope,

      "state": state ?? config.appName,

      // "code_challenge_method": "S256",

      // "nonce": nonce,

      // "code_challenge": generateCodeChallenge(codeVerifier),

      "redirect_uri": config.redirectUri

    });

  }

please fix sources?

ps: still not works for flutter build web --release (

@casbin-bot
Copy link

@casbin-bot casbin-bot added the bug Something isn't working label Nov 16, 2022
@muchengl
Copy link

muchengl commented Nov 22, 2022

Hello,
I tried to fix this problem. Do you mean that in your project, the SDK code needs to be modified as follows to work normally?
图片 1

However, in my demo, the sdk can't work if doing this modification. So I can't repeat the problem.

I wonder, maybe I misunderstand your issue or your issue can only happen in some special situations. Could you give me some more details?
Thanks!

@caoshengdong
Copy link

@pyxiscloud Can you provide a demo project?

@pyxiscloud
Copy link
Author

Hello @muchengl
Yes, I mean that (without changing SDK code not running normally)
I think it depends on Casdoor server settings, but not sure. My casdoor server only with captcha provider.
My steps:

  1. Deploy clean casdoor (docker) + add 1 application with Sign Up only with captcha provider.
  2. Trying to test it with demo example.

@muchengl
Copy link

@pyxiscloud Hello,
I have set up a demo according to your steps and encountered a "cross-domain problem". Is this your problem? Or you may have encountered another error.
截屏2022-11-23 19 52 20

@hsluoyz
Copy link
Member

hsluoyz commented Nov 24, 2022

@pyxiscloud can you run the Flutter example code? https://github.com/casdoor/casdoor-flutter-example

@pyxiscloud
Copy link
Author

no, that example not works
testing on Chrome, development mode (flutter web)

  1. I've pressed FAB button
  2. New window opens with Casdoor Login Window
  3. I 've entered as admin (admin - 123)
  4. Window was closed, but token is still "User is not logged in"

image

@hsluoyz
Copy link
Member

hsluoyz commented May 13, 2023

The example code: https://github.com/casdoor/casdoor-flutter-example works. So don't know why the issue owner doesn't work.

Closed as stale.

@hsluoyz hsluoyz closed this as completed May 13, 2023
@hsluoyz hsluoyz added invalid This doesn't seem right and removed bug Something isn't working labels May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

5 participants