0D54z00008jTV7vCAGOkta Classic EngineAPI Access ManagementAnswered2023-01-28T00:52:16.000Z2023-01-27T13:11:35.000Z2023-01-28T00:52:16.000Z
403 error when making call to get emails [React-Native AXIOS]

I’m currently trying to get my application to read user emails from connected Okta accounts, however I keep getting a 403 error in return.

 

I’m using a framework which gets the accessToken, refreshToken and idToken when the user is logged in and the call I’m making to the api is as follows where the bearer token is the access token and the idToken is it’s namesake. Am I to understand that the idToken in the context of the API pertains to something else?

 

An excerpt of the code I'm using is:

const headers = {

Accept: "application/json; okta-version=1.0.0",

Authorization: `Bearer ${bearerToken}`

}

axios({

method: 'get',

url: `https://${yourOktaDomain}/idp/myaccount/emails/${idToken}`,

headers: headers

}).then((response) => {

console.log(response.data);

}).catch((err) => {

console.error(err);

});


This question is closed.

Recommended content

No recommended content found...