A developer is building a serverless web portal for a medical scheduling system. Users must authenticate using their corporate Google Workspace accounts through OpenID Connect (OIDC). Once authenticated, the web portal must invoke private API routes hosted on Amazon API Gateway. The developer needs to validate the user session token at the API Gateway layer with the least operational overhead and without writing custom validation code.
Which solution meets these requirements?
- Configure an Amazon Cognito User Pool federated with the Google Workspace OIDC provider, and set up an API Gateway Cognito authorizer that directly validates the identity tokens.Cevap
- BConfigure an Amazon Cognito Identity Pool federated with the Google Workspace OIDC provider, enable AWS IAM authorization on API Gateway, and sign the client API requests using AWS Signature Version 4.
- CConfigure an Amazon Cognito User Pool federated with the Google Workspace OIDC provider, and write a custom API Gateway Lambda authorizer to parse and validate the JSON Web Tokens (JWT) manually.
- DConfigure an Amazon Cognito Identity Pool federated with the Google Workspace OIDC provider, and create an API Gateway Cognito authorizer linked to the Identity Pool to validate the client tokens.
Cevap
Configure an Amazon Cognito User Pool federated with the Google Workspace OIDC provider, and set up an API Gateway Cognito authorizer that directly validates the identity tokens.
The correct solution uses an Amazon Cognito User Pool to handle the OpenID Connect federation with Google Workspace, which issues standard JSON Web Tokens. By using the built-in API Gateway Cognito authorizer, API Gateway validates these tokens automatically, eliminating the need to write custom validation logic or perform complex request signing on the client.
Adım Adım Çözüm
Anahtar Kavram
Selecting the correct Cognito service and API Gateway authorizer type to minimize custom development when integrating external identity providers.
Tahmini Süre:1m 30s