M
M
mirexdoors2020-11-24 12:28:40
Android
mirexdoors, 2020-11-24 12:28:40

How to redirect to the application after logging in to the API?

Hello!
I ran into a problem:

1) I log in to a third-party API using flutter_web_auth:

_loginAction() async {
    String url =  'https://cloud.ouraring.com/oauth/authorize?client_id=${authInfoParameteres.clientId}&redirect_uri=authRedirect:/&state=${authInfoParameteres.state}';
    final result =  await FlutterWebAuth.authenticate(url: url, callbackUrlScheme: 'authRedirect');
}


In AndroidManifest.xml:
<activity android:name="com.linusu.flutter_web_auth.CallbackActivity" >
            <intent-filter android:label="flutter_web_auth">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="authRedirect" />
            </intent-filter>
        </activity>

2) Login page correctly opens in webview, all parameters are correct. But after the login login, there is no redirect back to the application. And here I don’t quite understand on which side the error occurs: on the api or flutter side? If api, then how can I debug the webview in the emulator?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question