xxxxxxxxxx
{
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": "admin",
"http://schemas.microsoft.com/ws/2008/06/identity/claims/role": "Admin",
"exp": 1662217645
}
xxxxxxxxxx
let b64DecodeUnicode = str =>
decodeURIComponent(
Array.prototype.map.call(atob(str), c =>
'%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
).join(''))
let parseJwt = token =>
JSON.parse(
b64DecodeUnicode(
token.split('.')[1].replace('-', '+').replace('_', '/')
)
)