Search code examples
curloauth-2.0amazon-cognitoaccess-token

AWS cognito, domain not returning access token


I created a user pool in cognito and set up OAuth2 agent in Cognito. Now iam trying to return the access token using the curl command . Below is the command

curl -X POST --user clientid:secret "https://mypooldomain.auth.eu-west-1.amazoncognito.com/oauth2/token?grant_type=client_credentials" -H 'Content-Type: application/x-www-form-urlencoded'


But below i am getting following error

curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
curl: (6) Could not resolve host: application

i tried with different ways from google that all point to the issue with the curl command. But nothing working fine in this case. How to resolve this kind of issue Appreciate if anybody can help on this ?

Thanks


Solution

  • You should get tokens with oauth2.0 endpoints. Details are here: https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html