How to implement DPoP or other proof-of-possession techniques for AWS cognito

0

We're interested in implementing proof-of-possession, like DPoP to secure OAuth tokens sent from the client to our Cognito authentication backend against replay attacks. Is there functionality built into the Cognito user client SDKs (or Amplify client SDKs) that supports this.

Or is the recommendation that we should just build our own client libraries and implement authentication lambdas and do it ourselves? If the later, please consider adding support for this to your roadmap. This functionality is currently supported by other identity services in some capacity like Okta, Auth0, ConnectId, Google cloud, Azure etc.

https://developer.okta.com/docs/guides/dpop/nonoktaresourceserver/main/

2 Answers
0

Hello

You are right, as of today the best way to do this is to implement a lambda trigger, as described in this doc : https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html

Best regards Serge

AWS
Serge
answered 2 months ago
0

Hello there,

I understand that you would like to know if there is an existing functionality with Cognito to implement proof-of-possession to secure OAuth tokens sent from the client to Cognito authentication backend against replay attacks.

At the moment, AWS Cognito does not have a native functionality to implement proof-of-possession to secure OAuth tokens sent from the client to Cognito authentication backend.

However, as you pointed out correctly the above use case can be achieved by implementing authentication Lambdas/ Lambda triggers on your Cognito Userpools. The below document elaborates more on integration of Lambda triggers with Cognito userpools.

[+] https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html

Additionally, Cognito now supports customisation of access tokens via a Lambda trigger. The below article give more details on the same and how to achieve your requirement with a Pre token generation Lambda trigger.

[+] https://repost.aws/articles/ARlRBV5B86TzmrD6TJvMuHpQ/aws-cognito-finally-supports-custom-claims-for-access-tokens

AWS
Shreeya
answered 2 months ago