
RakeshS.25709 (Customer) asked a question.
Hi Team,
I followed the steps mentioned in doc - https://developer.okta.com/docs/guides/implement-oauth-for-okta-serviceapp/main/
Section Create and sign the JWT -> In this, For testing purposes, use this tool to generate and sign a JWT. This tool link is not working. I got work around with API call, I am able to generate the JWT token.
Section Get an access token -> I am using JWT token to get access token but not getting the token. Getting 'Bad Request' in post main when executing via online curl runner (https://reqbin.com/curl) then getting 'invalid_client'.
As per doc in this section, no client id required, could you please help me with the solutions?
I am trying to get token api rest api and use in subsequent rest api call. I need to validate the token, if valid then proceed else return error.
I will be happy if you can help me with API gateway integration doc along with above query.
Curl Command:
curl --location --request POST 'https://integrator-******.okta.com/oauth2/default/v1/token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=okta.users.read' \
--data-urlencode 'client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
--data-urlencode 'client_assertion=eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJodHRwczovL2ludGVncmF0b3ItMTc2MTI4OS5va3RhLmNvbS9vYXV0aDIvZGVmYXVsdC92MS90b2tlbiIsImlhdCI6MTc2MjE1NTc4MiwiZXhwIjoxNzYyMTU2MDgyLCJpc3MiOiIwb2F3djFyZ3I3TWFsOTJqWTY5NyIsInN1YiI6IjBvYXd2MXJncjdNYWw5MmpZNjk3IiwianRpIjoiMmI5YjY2YzQtODY0MS00MzNlLWExMmEtZGNiZjgwYTU3NzMwIn0.WAcjmVa8z1rYK_E5Feqw10fYkBd59chG1AxIVxyQ37MaMo31I6D-l6ux0IT9Oowa3HWcoLCUfCCdEd-Om9OlUiZnoADI_7diDGAaonCBCqPOI6_VKSsZVBLwcP1mFQhltnQTKkMcM6Mmy9-675llJWXXKvwCrVumOi0HzzzIRB6nKzac7HsxY5Apibv9xCgpkdyXpRG3PDroyww5rGymuKtGtmB59ha-EiXEiVJcXQ4PcCdEAf8tyxxV2gTkIRbeDDinBlV-MYWSmktPsNpH_fYMbwyy1zqPF_67UQq_yh11vSV_xWrkFJq9Vfzz8rP0H2k2s9L40OdeE4XvyQs61A' \
--data-urlencode 'client_id=0oawv1rgr7Mal92jY697'

the client ID exists in the signed JWT. double-check that you put the correct clientID in that signed JWT. also double check the Oauth app config itself to make sure its enable for oauth for okta and is using the same keys you used to sign the JWT
https://developer.okta.com/docs/guides/implement-oauth-for-okta-serviceapp/main/?_gl=1%2a37cu8f%2a_gcl_au%2aNTgzMjQ4MzI5LjE3NjAzNzg1ODc.%2a_ga%2aMTg4Nzg2MjU2Ni4xNjgwMTg0Njg2%2a_ga_QKMSDV5369%2aczE3NjIzNTE4ODAkbzU1JGcxJHQxNzYyMzUyMzQ0JGozNiRsMCRoMA..#create-and-sign-the-jwt