Перенаправление на схему com.app.app запрещено.
Вот код
Код: Выделить всё
oauth2.dart
Код: Выделить всё
Future login() async {
try {
final AuthorizationTokenResponse result =
await appAuth.authorizeAndExchangeCode(
AuthorizationTokenRequest(
'client_id',
'com.app.app:/oauthredirect',
// discoveryUrl:
// "http://10.0.2.2:8000/api/oauth2/.well-known/openid-configuration",
serviceConfiguration: const AuthorizationServiceConfiguration(
authorizationEndpoint: 'http://10.0.2.2:8000/api/oauth2/authorize',
tokenEndpoint: 'http://10.0.2.2:8000/api/oauth2/token',
),
scopes: ['openid', 'profile', 'email'],
),
);
print("Received Token!");
// Successfully received the token
print(result);
} catch (e) {
print('Login error: $e');
}
}
Код: Выделить всё
build.gradle
Код: Выделить всё
defaultConfig {
applicationId "com.app.app"
minSdkVersion 26
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
manifestPlaceholders += [appAuthRedirectScheme: 'com.app.app']
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... sful-login