I’m pretty new to this okta world and exploring an option for our auth for our React-based Web and Mobile App. So maybe, I’ve overlooked and don’t know how to use Okta’a REST API via Axios.
This didn’t work. I’m getting the following error -
[TypeError: _okta.default.get is not a function. (In ‘_okta.default.get(’/api/v1/users?limit=25’)’, ‘_okta.default.get’ is undefined)]
I’ve no clue what’s going on with this one.
My end goal is to use Okta’s User Type and Users REST APIs to maintain the users.
The Users endpoint is not CORS enabled and you should definitely not be sending an api token along in a front end call, so I hope you are using Axios from a Node server instead…
I could be wrong, but I thought for axios it should be headers instead of header
That you’re getting a 403 is odd and would imply there’s something wrong with how you’re authorizing this call. You might want to check what the network event for this call looks like when its actually made to Okta to see if the Authorization header is being included correctly.
Hi @andrea, One more quick question on this thread -
I’m trying to add a user to a user group (Let’s say - contractors) as shown below -
{
“profile”: {
“login”: “isaac33@xyz.com”,
“email”: “isaac321@{{email-suffix}}”,
“mobilePhone”: “+11234567890”,
“userType”: “Contractor”
},
“credentials”: {
“password” : { “value”: “TestUser123” }
},
“groupIds”: [
“Contractor”
]
}
It works without the user group but throwing an error -
“errorSummary”: “Not found: Resource not found: Contractor (UserGroup)”
I added the user group and assigned the App to it, similar to the “Everyone” group. I think I’m doing something different.