Closed Asncodes-80 closed 1 year ago
Hi @Asncodes-80
In short your problem is related to callback uri.
You should understand how the authorization code flow (in Open ID Connect & OAuth, world) work:
By the side, your Identity Provider, have certainly an option "register a native app or mobile", or again someting like that. This should allow you to register some redirect_uri /callback uri like com.mydomain.myapp://login-callback
As you can notice, this type of redirect_uri is a custom scheme and should make you app capable to handle incoming link starting with this url scheme.
So pratically, I suggest you to:
Then in your android/app/build.gradle
defaultConfig {
// other config
manifestPlaceholders += [
'appAuthRedirectScheme': 'com.mydomain.myapp'
]
}
In the case your identify provider don't support native callback uri ou custom scheme in redirect_uri, you can a bridge server between your authorization server and your mobile application:
You can also check out this auth0 tutorial: https://github.com/auth0-blog/flutter-authentication
Thank
@Asncodes-80 You need to replace localhost with 10.0.02 like so
final String _discoveryUrl =
'http://localhost:8080/realms/myrealm/.well-known/openid-configuration'.replaceAll('localhost', '10.0.2.2');
Hi to Flutter app auth team. I have used from this plugin in flutter latest version. When i used from that with some conditions, callback url doesn't cause back to my application.
Result in url:
What i did in my application:
At first i should say, i used Strava api for authentication and getting authorization code. In that Strava developer panel, you can set only an address without any scheme before of that for callback url, like localhost. With
localhost
or any things I will get authorization code in url perfectly, But my main problem is return of callback address to app.dependency:
Main functionality
For Android in
android/app/build.gradle
:In
AndroidManifest.xml
For iOS in
info.plist
:For more information about my problem with
flutter_appauth
you can read my issue in Strava Google group system.