+++ title = "Authentication-OpenID Connect" weight = 17 +++ OpenID Connect (1.0) plugin allows the integration with a 3rd party identity provider (IdP) in a standardized way. This plugin can be used to implement Kong as a (proxying) [OAuth 2.0](https://tools.ietf.org/html/rfc6749) resource server (RS) and/or as an OpenID Connect relying party (RP) between the client, and the upstream service. The plugin supports several types of credentials and grants: Signed JWT access tokens (JWS) Opaque access tokens Refresh tokens Authorization code Username and password Client credentials Session cookies In this workshop, we will configure this plugin to use [Amazon Cognito](https://aws.amazon.com/cognito/) . A detailed integration guide is available [here](https://docs.konghq.com/enterprise/2.6.x/plugins/oidc-cognito/) for future reading. #### Creating AWS Cognito Run the following command to create the AWS Cognito Resources using a CloudFormation templates ```bash curl -O https://raw.githubusercontent.com/aws-samples/aws-modernization-with-kong/master/templates/cognito.yaml aws cloudformation deploy --template-file cognito.yaml --stack-name cognito-$C9_PID \ --parameter-overrides ClientName=$C9_PID-client Domain=$C9_PID PoolName=$C9_PID-pool CallBackUrl=https://$DATA_PLANE_LB/bar echo "export COGNITO_CLIENT_ID=$(aws cloudformation describe-stack-resources --stack-name cognito-$C9_PID | jq -r '.StackResources[] | select(.ResourceType=="AWS::Cognito::UserPoolClient") | .PhysicalResourceId')" >> ~/.bashrc bash echo "export COGNITO_POOL_ID=$(aws cloudformation describe-stack-resources --stack-name cognito-$C9_PID | jq -r '.StackResources[] | select(.ResourceType=="AWS::Cognito::UserPool") | .PhysicalResourceId')" >> ~/.bashrc bash echo "ISSUER=https://cognito-idp.$AWS_REGION.amazonaws.com/$COGNITO_POOL_ID/.well-known/openid-configuration" >> ~/.bashrc bash ``` **NOTE** We are using `$C9_PID` environment variable in the above commands, so that each cognito pool created by users of this workshop is unique. If you are running this workshop at your own cadance without AWS Cloud9 environment, ensure to set this environment variable Fetch the client secret ```bash echo "export CLIENT_SECRET=$(aws cognito-idp describe-user-pool-client --user-pool-id $COGNITO_POOL_ID --client-id $COGNITO_CLIENT_ID --query 'UserPoolClient.ClientSecret')" >> ~/.bashrc bash ``` #### Installing OIDC Plugin ```bash cat <