I have a web app which uses the Xero.NetStandard.OAuth2Client
package to allow for authentication with Xero.
Once the user is redirected back into my app, I use the IXeroClient.RequestAccessTokenAsync
method to exchange their code for an IXeroToken
object, which allows me to make calls against the Xero API, as expected.
The one thing I do not know how to do, and which I can't seem to find in the official documentation, is how do I extract the user's details (namely their name and email address) from the IXeroToken
object.
As per the standard, the information is encoded as JWT string in the IdToken
property, but I am not sure how I am meant to get the information out of it without an additional dependency.