简体   繁体   中英

Curl request for implicit grant type on fiware keyrock?

I wanted to fire a curl request for implicit grant type on fiware idm. I have gone through the official docs of fiware idm-

https://fiware-idm.readthedocs.io/en/latest/oauth/oauth_documentation/index.html

Implicit grant type exists in fiware idm, but while making a curl request it throws the following error:

{"error":"unsupported_grant_type"}

My curl request is as follows:

curl -X POST -H 
"Authorization: Basic $(echo -n 56c32d7-c991-4da0-8b0a-018461ac583e6:0ec8898c-3bc7-12cd-8abd-0d6abgh01c56 | base64 -w 0)" --header "Content-Type: application/x-www-form-urlencoded" -d "grant_type=implicit&username=admin@test.com&password=1234" https://Keyrock_Host:Keyrock_Port/oauth2/token --insecure

Does anyone know about it ?

The body of your request is incorrect, it appears you are passing in the required data for the Password Grant not the Implicit Grant .

For an Implicit Grant in OAuth2 you need a token or code request passing the client-id :

GET /oauth/authorize?
response_type=token&
client_id={{client-id}}&
state=xyz&
redirect_uri={{callback_url}}

This is the case where an application itself is requesting access to resources, and the client-id and callback-url ar already registered within the IDM

see:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM