Oauth2 "Invalid grant_type parameter value" error when requesting access token using Password Grant Type | Adobe Higher Education
Skip to main content
Level 2
October 5, 2023

Oauth2 "Invalid grant_type parameter value" error when requesting access token using Password Grant Type

  • October 5, 2023
  • 1 の返信
  • 1855 ビュー

Hello,

 

I'm trying to get access token using Password Grant Type:

 

curl --location --request POST 'http://<HOST>:<PORT>/oauth/token?username=<USERNAME>&password=<PASSWORD>&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&grant_type=password&redirect_uri=<REDIRECT_URI>' --header 'Content-Type: application/x-www-form-urlencoded'

 

 

However, that results in the following error:

 

{"error_description":"Invalid grant_type parameter value","error":"invalid_request"}curl: (18) transfer closed with outstanding read data remaining

 

 

AEM ver is 6.5

 

Any help appreaciated.

このトピックへの返信は締め切られました。

1 の返信

aanchal-sikka
Community Advisor
Community Advisor
October 6, 2023

Hello @dwid1 

 

Please try with following grant_type:

client_credentials

refresh_token

authorization_code

Aanchal Sikka
dwid1作成者
Level 2
October 6, 2023

Hello @aanchal-sikka

I cannot use refresh_token / authorization_code as they do not exchange the user’s username and password for an access token.

 

These are the grant types to exchange the user’s username and password for an access token:
https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ or 
https://www.oauth.com/oauth2-servers/access-tokens/password-grant/

 

However, both the grant types:
password,
client_credentials

result in the same error:

 

{"error_description":"Invalid grant_type parameter value","error":"invalid_request"}curl: (18) transfer closed with outstanding read data remaining