I am using azure active directory OAuth for azure bot authentication.After logged in I got the token successfully, but how can I get the user details based on the token?
So, Is there is any way to parse the azure token in node.js and get the details about the user?
Basically the token you get is a JWT token base64 encoded. You can use a node package like jwtDecode to decode the contents of the token and get the claims.
You can do something like:
import jwtDecode from 'jwt-decode';
const claims = jwtDecode('base64 encoded token received from Azure AD');
claims will be a JavaScript object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With