Created
May 31, 2018 13:11
-
-
Save whisher/8711a59ce1f901f81cfcec0c3dbd8f2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const data = 'username=' + encodeURIComponent(credentials.username) + '&password=' + | |
| encodeURIComponent(credentials.password) + '&grant_type=password&scope=read%20write&' + | |
| 'client_secret=' + this.clientSecret + '&client_id=' + this.clientId; | |
| const headers = new HttpHeaders() | |
| .set('Content-Type', 'application/x-www-form-urlencoded') | |
| .set('Accept', 'application/json') | |
| .set('Authorization', 'Basic ' + this.base64('myapp' + ':' + 'mySecretOAuthSecret')); | |
| return this.http.post(this.urlLogin, data, { | |
| headers | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment