why is the Google OAuth Client Secret required for Cognito with Google as Identity Provider

0

Hello,

why is the Client Secret required for Cognito, if I want to use Google as IdP with my hosted ui?

In the OpenId-workflow the Authorization grant code is passed to the redirect_uri by Google through Cognito. Then my server would need to exchange the Authorization grant code for a Access token & Identity Token at google by sending the client secret.

But Cognito should not need the client secret from google here, because it doesnt request a code exchange for me.

Thank you, if s.o. knows

mampf
已提問 6 個月前檢視次數 235 次
1 個回答
0
已接受的答案

When using federation it is often confusing which entity is playing which role at what point.

When you integrate Cognito with Google as an ODIC identity provider, Cognito is the corresponding relying party ("app") in the relationship with Google, not your "Server"(App). Cognito is using the client id/secret to do the code exchange. Cognito does that behind the scene and it is not visible to you. After that Cognito gives your application the tokens Cognito itself generates.

Please refer to the diagram and description here for how the signals flow: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-oidc-flow.html

Cognito acts as a relying party which provides token handling and management for authenticated users from all identity providers, so your backend systems can standardize on one set of user pool tokens.

AWS
已回答 5 個月前
profile picture
專家
已審閱 1 個月前
  • Thank you for claryfying & reply. So I need a Hosted UI just as a redirect endpoint used by Google for the OAuth workflow Will probably use Amplify in my react app together with Google Login & dont need a Hosted UI but the Google identity provider does need a Hosted UI probably.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南