Hi, I have a issue using the react SDK. I plan to manage all users within okta and haven’t had any luck getting user data back.
I keep getting a 401 response, if I edit the request and remove referrer and origin I get a successful 200. I have more details in my question at stack overflow.
React Code:
useEffect(() => {
if (!authState.isAuthenticated) {
// When user isn't authenticated, forget any user info
setUserInfo(null);
} else {
oktaAuth
.getUser()
.then((info) => {
setUserInfo(info);
})
.catch((error) => {
console.error(error);
});
}
}, [authState, oktaAuth]);
Is there a step I am missing, config that is incorrect? If I just pass the Auth token using postman the response comes back 200 with the user object, I just haven’t been able to achieve this in JS with Axios, or through the use of oktaAuth.getUser().