I'm trying to recibe the token for my users with this:
let url = 'http://localhost:9080/syncope/rest/accessTokens/login';
let headers = new HttpHeaders({
'Content-Type': 'aplication/adf',
'Authorization': 'Basic ' + btoa(username + ':' + password)
});
this.http.post(url, '', { headers }).toPromise()
.then(res => {
console.log(res);
});
And works ok because I recibe in the Chrome inspector:
1. Date:
Thu, 06 Dec 2018 00:15:25 GMT
2. X-Syncope-Domain:
Master
3. X-Syncope-Token:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJqdGkiOiJjZmFhZWZiNy0yZTgxLTRiMzctYWFlZi1iNzJlODEzYjM3NGMiLCJzdWIiOiJhZG1pbiIsImlhdCI6MTU0NDA1MDUzOSwiaXNzIjoiQXBhY2hlU3luY29wZSIsImV4cCI6MTU0NDA1NzczOSwibmJmIjoxNTQ0MDUwNTM5fQ.JL-1bTdx3njvGYdR1R_gOtvqXloFW95_vvItncDv1TgM5gF-K99J31rKEaNgtW7zIKgFl707xk2_h4cKpHfa4g
4. X-Syncope-Token-Expire:
2018-12-06T01:55:39+01:00
but I can't access to this header because the console.log(res) trhow null.
How can I get the token?
dadf