title: How to decode the JWT encoded token payload on client-side in angular?
body: <p>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:</p>
  <pre><code> setXAuthorizationToken(client){
      let requestHeader = new Headers();
      requestHeader.append('Content-Type', 'application/x-www-form-urlencoded');
      this.http.post(client.clientURL + &quot;oauth/token&quot;, 'grant_type=password&amp;client_id=toto&amp;client_secret=sec&amp;' +  'username=' + client.username
      + '&amp;password=' + client.password, {
        headers: requestHeader
      }).map(res=&gt;res.json())
      .subscribe((token) =&gt;{
        if(!token.access_token){
            return;
        }
        else{
         var decompressToken = LZString.decompressFromEncodedURIComponent(token.access_token);
         console.log(decompressToken);
  }
      });
      }
  </code></pre>
  <p>Can anybody please help me solve this issue?</p>