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

Google Oauth 2.0 fail #37

Open
thaarrtt opened this issue Mar 7, 2024 · 8 comments
Open

Google Oauth 2.0 fail #37

thaarrtt opened this issue Mar 7, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@thaarrtt
Copy link

thaarrtt commented Mar 7, 2024

from example repository

image

oauth blocked because need proper user-agent

@casbin-bot
Copy link

@casbin-bot casbin-bot added the question Further information is requested label Mar 7, 2024
@hsluoyz
Copy link
Member

hsluoyz commented Mar 8, 2024

@thaarrtt what's this screenshot? Are you using the example code: https://github.com/casdoor/casdoor-flutter-example or it's your own app?

What's the mobile device? brand and version and OS version

@thaarrtt
Copy link
Author

thaarrtt commented Mar 8, 2024

@thaarrtt what's this screenshot? Are you using the example code: https://github.com/casdoor/casdoor-flutter-example or it's your own app?

What's the mobile device? brand and version and OS version

its from example repository and its generic android emulator with latest sdk

@heralight
Copy link
Contributor

A partial fix is available in #38 , the remaining is to work arround the google signin custom scheme limitation to trigger the callback.

@hsluoyz
Copy link
Member

hsluoyz commented Mar 10, 2024

@heralight thanks for PR and 1.5.0 has been released: https://pub.dev/packages/casdoor_flutter_sdk/versions/1.5.0

How to fix the remaining part?

@hsluoyz hsluoyz added bug Something isn't working and removed question Further information is requested labels Mar 10, 2024
@heralight
Copy link
Contributor

@hsluoyz
At the end of the day, this sdk is too much outdated and has a lot of bad practices (no appauth or custom tab) and secrets are not well managed.

prefer to use https://pub.dev/packages/oidc directly, it work with casdoor like:

final userManager = OidcUserManager.lazy(
  discoveryDocumentUri: OidcUtils.getOpenIdConfigWellKnownUri(casdoorIssuer),
  clientCredentials:
      const OidcClientAuthentication.none(clientId: appClientId),
  store: OidcDefaultStore(),
  settings: OidcUserManagerSettings(
    redirectUri: redirectUri,
   extraAuthenticationParameters: {    'organizationName': 'myorg',
    'appName': 'myapp',},
    // the same redirectUri can be used as for post logout too.
   // postLogoutRedirectUri: redirectUri,
    scope: ['openid', 'profile', 'email'],
  ),
);

best regards,

@hsluoyz
Copy link
Member

hsluoyz commented Mar 13, 2024

@heralight can you make a PR?

@heralight
Copy link
Contributor

@heralight can you make a PR?

As I said, I don't use this casdoor-flutter-sdk anymore, just use https://pub.dev/packages/oidc directly as my precedent sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants