How to do Okta sign in with flutter and authenticate with back-end Api (Just like google sign-in)


I am trying to implement okta in my mobile app the details goes like the following

1 - I am using flutter + google sign-in

2 - I am willing to replace google sign-in with okta

the scenario in google sign-in goes like that :

1- the user click sign-in in the mobile app

2- type in the email and pass and sign in

3- google sign in will forward the user data to the login redirect route which is my back-end API

4 -my back-end api return the JWT to the mobile app for further calls

in Okta what I achieved so far

1- I created a native app authentication, I used the flutter_okta_sdk: ^1.0.0-dev.7 (flutter_okta_sdk | Flutter Package)

2- I can authenticate with okta successfully in the mobile app following the steps ( GitHub - sonikro/flutter-okta-sdk: Okta's SDK Implementation for Flutter )

3- but the redirect url is (non http) on the app like : com.mycompany:/logn

4- so I manually redirected the result of the sign in to my back-end APi

5- and created OIDC - OpenID Connect - Web Application and used it to confirm the access tokens and Ids

 ( which works correctly but its not the best scenario ) 

kindly note the following:

if I used the “OIDC - OpenID Connect - Web Application” in flutter mobile app, the app caches (I expected is to do so, but I wanted to use an https redirect url )

my problem is how to make the sign in proccess redirect to the back end ??

( the other option is let the user type in the email/password directly into the mobile app then I authenticate from the back-end )

or is there anything I missed in the documentations ??

I appreciate your effort

Shenouda Mikhael