<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00005tKN1cSAGOkta Classic EngineAdministrationAnswered2024-04-13T06:26:32.000Z2019-01-22T05:39:15.000Z2019-01-22T15:22:46.000Z

AwneeshR.17415 (Customer) asked a question.

I am getting cors error while using find user request using find User Okta API.

 

public _url = "https://dev-*******-admin.oktapreview.com"

//This is my find user service.

findUser(user): Observable<any>{

 

var reqHeader = new HttpHeaders({ 'Accept': 'application/json','Content-Type': 'application/json', 'Authorization':'SSWS' + this.apikey, "Access-Control-Allow-Origin":'*', "Access-Control-Allow-Methods": 'GET,POST,PATCH,DELETE,PUT,OPTIONS', "Access-Control-Allow-Headers": 'Origin, Content-Type, X-Auth-Token, content-type' });

return this._httpClient.get(this._url + '/api/v1/users?q=' + user , { headers:reqHeader });

}

 

//Here i am calling my findUser() function

 

this._userService.findUser(this.loginForm.value.username).subscribe((response)=>{

console.log(this.loginForm.value.username)

console.log(response);

},(err)=>{

console.log(err);

});

 

 

 

I am using find user functioon inside the loginFunc user function.like this

 

 

 

this._userService.loginFunc(value).subscribe((res) => {

console.log(value)

this.data = res;

console.log(" this is the response --" + this.data);

 

 

 

this._userService.findUser(this.loginForm.value.username).subscribe((response)=>{

console.log(this.loginForm.value.username)

console.log(response);

},(err)=>{

console.log(err);

});

},(err) => {

console.log("This is the error-- " + err)

});

Basically i am using Find user API inside primary Authentication API. I am getting cors error in Find User API only. Please Help me with this..

 

 

 


  • mg890 (mg890)

     

    try removing the -admin , when going to the admin portal, it will add this by default but it's not your Okta Org URL

     

     

     

This question is closed.
Loading
I am getting cors error while using find user request using find User Okta API.