How to decode the JWT encoded token payload on client-side in angular 5?
问题 I am getting one JWT encoded access token from my API in response. But I am not able to decode it and get it in JSON format. I tried using the angular2-jwt library for it, but it did not worked. I am writing my code below: setXAuthorizationToken(client){ let requestHeader = new Headers(); requestHeader.append('Content-Type', 'application/x-www-form-urlencoded'); this.http.post(client.clientURL + "oauth/token", 'grant_type=password&client_id=toto&client_secret=sec&' + 'username=' + client