Giter Club home page Giter Club logo

casdoor-flutter-sdk's Issues

dependency conflict

Because casdoor_flutter_sdk >=1.4.1 depends on flutter_inappwebview ^5.8.0 and building depends on flutter_inappwebview ^6.0.0, casdoor_flutter_sdk >=1.4.1 is forbidden.
So, because building depends on casdoor_flutter_sdk ^1.5.0, version solving failed.

Please update http dependency

Hi,
In my project with casdoor SDK, can't update http package version:
Because casdoor_flutter_sdk 1.5.0 depends on http >=0.13.4 <1.0.0 and no versions of casdoor_flutter_sdk match >1.5.0 <2.0.0, casdoor_flutter_sdk ^1.5.0 requires http >=0.13.4 <1.0.0. So, because flutterweb depends on both http ^1.2.1 and casdoor_flutter_sdk ^1.5.0, version solving failed.
Please use newer version of http?
Thank you

Rationale for using native implementation of WebView

Why did you choose to implement the WebView in native code on Android and iOS?

From my perspective there is no real advantage there. It would be better to use the flutter_inappwebview package which supports Android, iOS, macOS and the web. Windows and Linux support could be added using the desktop_webview_window package.

IMHO the main disadvantage of the current solution is the usage of the system's default browser. There you have no control over cookies (that is especially bad when you want to log out from 3rd party provider using the SDK) and you have no fullscreen mode. Even worse on iOS you have to confirm that you really want to open the Casdoor website on the first attempt.

If this appears useful to you I want to offer my help in migrating the SDK to use the packages mentioned above.

Problem with refreshToken method

When I try to refresh token with method

  Future<http.Response> refreshToken(String refreshToken, String? clientSecret,
      {String scope = "read"}) async {
    return await http.post(
        Uri(
          scheme: parseScheme(),
          host: parseHost(),
          port: parsePort(),
          path: "api/login/oauth/refresh_token",
        ),
        body: {
          'grant_type': 'authorization_code',
          'refresh_token': refreshToken,
          'scope': scope,
          'client_id': config.clientId,
          'client_secret': clientSecret
        });
  }

, I never get answer with the new token. Tried with/without clientSecret, tried with access/refresh/auth tokens (because thought that have incorrect variable for token) -- no luck. But if I try to do this request manually

final response = await http.post(
    Uri(
      scheme: "https",
      host: dotenv.get('CASDOOR_ENDPOINT').split("//").last,
      port: 443,
      path: "api/login/oauth/refresh_token",
    ),
    body: {
      'grant_type': 'refresh_token',
      'refresh_token': data.token.refreshToken,
      'scope': "read",
      'client_id': dotenv.get('CASDOOR_CLIENT_ID'),
      'client_secret': dotenv.get('CASDOOR_CLIENT_SECRET'),
    });

, I get the new token. What problem could be in library's method?

Not works on Flutter Web release

Hello,
I've build release for Web and got this error in Chrome:
Uncaught MissingPluginException(No implementation found for method authenticate on channel casdoor_flutter_sdk)

At development stage thats ok, but release is broken

refreshToken for mobile app

I'm interested in the refreshToken method. If the app is an Android/iOS app it is a pretty bad idea to put the client_secret into the code as it can be easily retrieved by decompiling the app.

Is there any other way to obtain a refresh token using the SDK that does not involve supplying the client secret?

Fix error in code

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 (

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.