
AwneeshR.17415 (Customer) asked a question.
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..

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