4

I'm currently developing a Flutter application with Keycloak as authenticating server using Open_id flutter package.

I have implemented email & password signin using Keycloak restApi for username & password sign in

I need to add google signIn in my app. But it open custom webview for google signin.

Google signin flow : Flutter App trigger Open id - authenticator with keycloak credential

--> opens custom webview

--> keycloak signIn page

--> redirects to google account signin

--> keycloak verification page

--> closes webview and return keycloak token (contains user info).

and some time the custom Webview tab doesn't closes automatically.

I have used google_sign_in to generate idToken and accessToken. and in backend used the google restApi ('https://www.googleapis.com/oauth2/v2/tokeninfo?id_token=) to get user info.

Is there any restApi for Keycloak sign in using Google idToken/AccessToken .

or any other way of authenticate keycloak using custom token ?, so i can set google api as verification url for authenticating.

Bharath
  • 1,036
  • 10
  • 13
  • Did you solve this? – Stuck Aug 24 '21 at 19:27
  • 1
    yes, but not exactly. I just changed the flow,1. Added deeplink functionality using ui_links package. 2. Set the deeplink uri as redirect url in Keycloak console. 3. Using url_launcher pushed the keycloak google sign url with redirect url as deeplink url to browser app(not a custom webview/tab). So, after that google sign in will redirect to keyclaok, it will authenticate google idToken, and redirects to deeplink url with auth-code and state. Parses the auth code with uni_links and sends the code to backend via rest and receives the user info, access token, etc – Bharath Aug 25 '21 at 03:20
  • thanks we will give it a try – Stuck Aug 25 '21 at 10:17

0 Answers0