I tryng to get a token with a JS Client. so I configu my client just like
the image, and this is my code (Axios) to try to get the token:
this.axios.post('
http://localhost:9090/auth/realms/Lumera/protocol/openid-connect/token';, {
username: this.email,
password: this.senha,
grant_type: 'password',
client_id: 'central-api'
},
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
},
).then((response) => {
console.log('ok');
},
).catch((error) => {
console.log('erro');
});
but I got the error:
Failed to load
http://localhost:9090/auth/realms/Lumera/protocol/openid-connect/token: No
'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:8080' is therefore not allowed access. The
response had HTTP status code 400.
[image: Screen Shot 2018-10-15 at 21.00.51.png]
If i use postman to get a token works fine. so the Web Origins should works
in this case?
tks