slow motion
slow motion

Reputation: 33

How to select and work with a particular Provider (OIDC provider) added on Google Could - Identity platform by using server side java code

I have added these 2 identity providers (refer attached images) to Google Cloud -->Identity Platform

  1. Email/Password
  2. OIDC Connect (oidc provider)

Now if you see there is a User section as well under Identity Platform So I have added some random users which are non gmail users (refer image), like [email protected], which I want to authenticate with the help of Google Cloud (it when this user comes to login, I will hit API endpoint /login and in login server side code, I will redirect to Google Cloud to Authenticate this user using OIDC Authorization flow)

I need Java code to :

  1. Using some java code, First choose the provider as OIDC provider (oidc-auth-provider).
  2. Make call to Google Cloud which should use this Provider (oidc-auth-provider)
  3. This oidc-auth-provider should look up the users which I have created under Users section (refer image)
  4. Google Cloud after verifying user exist, should send back with Auth Code
  5. using Auth Code I will call back to Google and get ID token/JWT token

I was referring to this link : https://cloud.google.com/identity-platform/docs/web/oidc If you search "Signing in users with OAuth" this section on page, that is what exactly I am looking for, but the problem is it has given a UI code example using Firebase API example, to create OAuthProvider instance (which will choose provider), but I need server side code example instead, I am not sure if I can use this Firebase API on server side java code for a web application? Any suggestion that how can I do similar things from a server side Java code?

added Providers under Identity-platform

Added users manually which I wanted to authenticate

Upvotes: 2

Views: 222

Answers (0)

Related Questions