Hi,
I’m sorry if I am not aware or have missed something. I’ve implemented an Implicit Flow, even the validation part. But I also need to manage Okta’s Users and Groups API.
I have an API Token and it works perfectly, using curl, for example:
curl -v -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{
"profile": {
"name": "West Coast Users",
"description": "All Users West of The Rockies"
}
}' "https://dev-000000.oktapreview.com/api/v1/groups"
But when I’ve tried to get them from my Client (Angular SPA) I get the CORS error :
XMLHttpRequest cannot load https://dev-000000.oktapreview.com/api/v1/groups. Origin http://localhost:4200 is not allowed by Access-Control-Allow-Origin.
when I already had enabled CORS for the required origins
http://some.domain.s3-website.us-east-2.amazonaws.com
CORS
Redirect
http://localhost:8080
CORS
Redirect
http://localhost:4200
CORS
Redirect
https://developer.okta.com
CORS
Redirect
The code for the request is the following:
getAll(): Observable<any> {
let httpHeaders = new HttpHeaders().set('Accept', 'application/json')
.set('Content-Type', 'application/json')
.set('Authorization', 'SSWS ${api_token}')
return this.http.get('https://dev-000000.oktapreview.com/api/v1/groups', { headers: httpHeaders});
}
}
I also tried with:
.set('Authorization', 'Bearer ' + this.authService.getAccessToken());
please, what am I missing?
Thanks,
Sergio
