Home > OS >  Curl Authentication Code Client Secret and Client ID
Curl Authentication Code Client Secret and Client ID

Time:01-06

Hi Guys I have a question regarding to curl request for authentication. Apparently, I have all required information such as client ID, client secret, URL and authorization code, but it seems that everytime I send a request I never get the expected result. Can someone help me with curl request since I'm a beginner

curl -X POST 'https://identity.moneyhub.co.uk/oidc/token'
-H 'Authorization: Basic Base64_encode(<client_id>:<client_secret>)'
-H 'Content-Type: application/x-www-form-urlencoded'
-d 'grant_type=authorization_code&code=example-auth-code&redirect_uri=example-redirect-uri&sub=example-user-id'

CodePudding user response:

curl -X POST 'https://identity.moneyhub.co.uk/oidc/token' 
-H 'Authorization: Basic Base64_encode(<client_id>:<client_secret>)'

Add -u instead of -H:

-u 'Authorization: Basic Base64_encode…

CodePudding user response:

curl  -X POST https://identity.moneyhub.co.uk/oidc/token
-u <YOUR_KEY_ID>:<YOUR_SECRET>
-H 'Content-Type: application/x-www-form-urlencoded' 
-d 'grant_type=authorization_code&code=example-auth-code&redirect_uri=example-redirect-uri&sub=example-user-id'
  •  Tags:  
  • Related