When I use POST in CORS and trying to login via /v2/oauth/token
I get the error: Null reference passed as parameter
, I have debugged the issue, and it seems that the request parameters are empty.
But, if I login by sending the params in the url and not in the body, it is working.
This workaround is dangerous because the passwords will be logged with the HTTP log.
In angular:
this wont work:
this.httpClient.post(this.server + "/v2/oauth/token?grant_type=password",loginModel,{headers : header,withCredentials : true}).subscribe(x => {
debugger;
});
and this will work
this.httpClient.post(this.server + "/v2/oauth/token?grant_type=password&username=" + loginModel.username + "&password=" + loginModel.password,{},{headers : header,withCredentials : true}).subscribe(x => {
debugger;
});
I assume that this is not a BUG in cuba, am I missing something with the CORS in java?
Thanks