Cors error with axios

i tried to call '/api/v1/groups ’ on React using axios.

i added ‘http://localhost:8080’ in API-trusted origins.

but cors error keeps show up

this is my axios instance

const client: Axios = axios.create({
baseURL: ‘’,
headers: {
‘Content-Type’: ‘application/json’,
Authorization: SSWS ${api_token},
‘Access-Control-Allow-Origin’: *,
Accept: ‘application/json’,
‘Access-Control-Allow-Credentials’: ‘true’,
withCredentials: true,


what am i missing?



If you access the API from the front end or browser and the API does not support CORS, you will receive a CORS error. APIs that are not CORS-enabled can only be accessed from the server side or backend.

Please refer to our doc: Okta Help Center (Lightning)


thanks. i solved this problem.

as you said, api/v1/groups API dose not enable CORS.

i understood that there are some API can enable CORS , and rest can’t.

so i have to use other API or use it in backend.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.