What is the token introspection path for AWS Cognito

Viewed 1435

We are using vertx oauth2 components to implement login with cognito using oauth2 authorization code grant. We could implement the scenario using existing APIs. But vertx expect token introspect path in it's oauth2 config. Otherwise there is no way to ask from cognito whether the provided token to the resource server is correct or not. Anyway we could not find any information on what is the token instrospect context path on cognito documentation.

OAuth2ClientOptions oAuth2ClientOptions = new OAuth2ClientOptions()
                .setClientID("***************************")
                .setIntrospectionPath("") //what should goes here
                .setClientSecret("********************")
                .setSite("*****************")
                .setTokenPath("/oauth2/token")
                .setAuthorizationPath("/oauth2/authorize")
                .setFlow(OAuth2FlowType.AUTH_CODE)
1 Answers

There is no introspection endpoint for AWS Cognito so you have to use a different approach:

  • Download token signing keys from the JWKS endpoint
  • Use a library to verify the token signature

If it helps, here is some nodejs code of mine that validates Cognito tokens.

I've not used vertx but it seems to support JWT Validation. Usually this involves including the JWKS or metadata URL in an Options object.

Related