how to request tokens using curl?
what i want:
- retrieve token as authenticated test user in Kinde and make call to rest api using curl
curl http://myapi.com/api -H 'authorization: Bearer {accessToken}'
what i've done:
- added my rest api app in Kinde
- added a test user with email:password in Kinde
- redirected test user to authz endpoint and obtained authz code via web browser
- curl POST to token endpoint with authz code but returned 400 bad request (invalid grant)
curl -X POST https://<my_kinde_sudomain>.kinde.com/oauth2/token -H 'content-type: application/x-www-form-urlencoded' -d 'client_id=<my_kinde_client_id>&client_secret=<my_kinde_client_secret>&grant_type=authorization_code&redirect_uri=<my_app_redirect_url>&code=<my_callback_authorization_code>'
1 Reply
Hi @Bini - would you be able to retry that with
grant_type=client_credentials
? That should return the access token, expires_in and token_type ☺️ thanks!