· 7 years ago · Oct 23, 2017, 06:12 PM
1POST /oauth/token HTTP/1.1
2Host: localhost:8080
3Authorization: Basic YXBwbGljYXRpb246c2VjcmV0
4Content-Type: application/x-www-form-urlencoded
5Cache-Control: no-cache
6Postman-Token: 9f9582e9-fe73-499f-d7f7-82498a974e39
7
8grant_type=password&username=pedroetb&password=password
9
10let headers = new Headers();
11 headers.append('Content-Type', 'application/x-www-form-urlencoded');
12 headers.append("Authorization","Basic YXBwbGljYXRpb246c2VjcmV0");
13
14 var obtainTokenUrl = 'http://localhost:8080/oauth/token';
15
16 this._http.post(obtainTokenUrl + "?grant_type=password&username=pedroetb&password=password", null, {headers: headers}).subscribe(response => {
17 console.log(response);
18 });