0

I saw a lot of answers on this question, but I want a valid answer, the access token from cognito is not working but the id_token works. That's my Authorizer:

ApiGatewayAuthorizer:
    Type: AWS::ApiGateway::Authorizer
    Properties:
      Name: ${self:custom.tablePrefix}-api-authorizer-${self:provider.stage}
      Type: COGNITO_USER_POOLS
      RestApiId: ${file(./config/${self:provider.stage}.yml):${self:provider.region}.deploymentRestApiId}
      IdentitySource: method.request.header.Authorization
      ProviderARNs:
        - !GetAtt CognitoUserPool.Arn

Authorizer

OAuth

Hulubina
  • 141
  • 1
  • 11

1 Answers1

0

You need to define a Resource Server in your Cognito User Pool and add AuthorizationScopes to your AWS::API::Methods. See this post and this Knowledge Base article for more details.

perpil
  • 1,521
  • 7
  • 5