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 个月前236 查看次数
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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则