Parse JWT token payload data to get certain value in android/java
<p>I just got introduced to the JWT and wanted to know how to parse the payload data to get a certain value from it using the key.</p>

<p>Example in the following JWT token          eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ</p>

<p>The payload data contains the following object when decoded in jwt.io</p>

<pre><code>{
    "sub" : "1234567890"
    "name" : "John Doe"
    "admin" : "true"
}  
</code></pre>

<p>I want to be able to parse this object to get the value of name which in this case is John Doe from the above JWT token.</p>

<p>I have already read this <a href="https://stackoverflow.com/questions/34998859/android-jwt-parsing-payload-claims-when-signed">Android JWT parsing payload/claims when signed</a></p>

<p>But i wanted to know if there is efficient way to do this in android using some library. Any help would be appreciated. </p>