I am getting The following Error : { "error": "invalid_client", "error_description": "Browser requests to the token endpoint must use Proof Key for Code Exchange." }
while going to authenticate with the Okta.
here is my Api token Request:
curl --location --request POST 'https://example.okta.com/oauth2/v1/token' \
--header 'authority: example.okta.com' \
--header 'accept: application/json' \
--header 'accept-language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'dnt: 1' \
--header 'origin: https://domain' \
--header 'pragma: no-cache' \
--header 'referer: https://domain/' \
--header 'sec-ch-ua: "Chromium";v="118", "Google Chrome";v="118", "Not=A?Brand";v="99"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: cross-site' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36' \
--header 'x-okta-user-agent-extended: okta-auth-js/7.4.3 @okta/okta-react/6.7.0' \
--header 'Cookie: JSESSIONID=170CE91EC697490ECFA09BA0F82C1B4C; proximity_1f9ef752d4bf75b63a55dcc7d276ae9a=eyJ6aXAiOiJERUYiLCJwMnMiOiJNbi0wMllEQ0RXSElqdk8xODZISnJ3IiwicDJjIjoxMDAwLCJ2ZXIiOiIxIiwiZW5jIjoiQTI1NkdDTSIsImFsZyI6IlBCRVMyLUhTNTEyK0EyNTZLVyJ9.4KvqMHeDowQM353vhbsNU0kIngyPEwQ1lGjVGKFaQsmZARSvv04LfQ.imdnhQK6WRakkTIH.wIDJvB7mENzSqlibUXlMIj9li1f9LHJXHOlLEo19OcGeZx7LZJ9ceuaDxQNVb1mgMTtOz9DM-asEl6rOdDEa9_o1RTPaqazxB5-jceh-fwOfucE0pZOghsSmeiYIAdusULtqDD0ERzlWdpBzm0xldZ3r46aOKeBuBOgKbkg11aPS6Q.4OkI9pkzooafoRCHnICQfw' \
--data-urlencode 'client_id=XXXXX' \
--data-urlencode 'redirect_uri=https://crm-dynamicmedia.corp.adobe.com/login/callback' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code_verifier=eecf7ee9fab8496b3d5219fa7530af1068a5f08efe0' \
--data-urlencode 'code=HhKeUnuXj6lrx83ksUAFD2Eh3bp9EWuSg9awQi_gKAI' \
--data-urlencode 'client_secret=XXXXXXX'
And My Okta Config:
export const oktaConfig = {
issuer: `https://example.okta.com`,
clientId: `XXXX`,
clientSecret: `XXXX`,
redirectUri: `https://domain/login/callback`,
scopes: ["openid", "profile", "email"],
response_type: ["id_token", "token"],
response_mode: "fragment",
pkce: true,
};
i also saw some of the okta community posts for the same but did not get any success.
please help me out for the same. Thank You.