casdoor / casdoor-flutter-sdk Goto Github PK
View Code? Open in Web Editor NEWFlutter SDK for Casdoor, see example at: https://github.com/casdoor/casdoor-flutter-example
Home Page: https://github.com/casdoor/casdoor
License: Apache License 2.0
Flutter SDK for Casdoor, see example at: https://github.com/casdoor/casdoor-flutter-example
Home Page: https://github.com/casdoor/casdoor
License: Apache License 2.0
Hi,
Are there any plans on supporting the Windows and Linux platforms any time in the future? :)
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.
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
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.
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?
Re-run 3 times, the same error: https://github.com/casdoor/casdoor-flutter-sdk/actions/runs/4966159985/jobs/8887940216
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
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?
See other languages: https://github.com/casdoor?q=sdk&type=all&language=&sort=
This SDK will be used by Flutter apps to connect to Casdoor authentication platform.
Hi. Could you please update pub.dev to 1.3.0 version, for using the refresh token fix in my project?
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
(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.