<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[When and how should I validate a JWT issued by FusionAuth?]]></title><description><![CDATA[<p dir="auto">When and how should I validate a token issued by FusionAuth via a login process?</p>
]]></description><link>https://fusionauth.io/community/forum/topic/2107/when-and-how-should-i-validate-a-jwt-issued-by-fusionauth</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 09:54:18 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/2107.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Jun 2022 23:30:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to When and how should I validate a JWT issued by FusionAuth? on Mon, 13 Jun 2022 23:35:03 GMT]]></title><description><![CDATA[<p dir="auto">Validating the token on every new connection is considered best practice as it is the most secure.</p>
<p dir="auto">There are two ways to validate a token. You can do it within your own application code leveraging a library that checks the signature and validates the claims (this only works when you sign your JWTs with a public key). Or you can do it by calling out to FusionAuth, and then validating the claims. For scalability/simplicity reasons, we recommend using the library unless there are reasons it won't work</p>
<p dir="auto">By doing this server side using a library you no longer need to make the API call to FusionAuth to perform the validation. You would only need the public key of whichever signing key was used by FusionAuth. More on that here: <a href="https://fusionauth.io/docs/v1/tech/core-concepts/key-master#overview" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/core-concepts/key-master#overview</a> The public key is available via JWKS.</p>
<p dir="auto">When using keys we also recommend you think about key rotation, explained in more detail here: <a href="https://fusionauth.io/docs/v1/tech/tutorials/key-rotation" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/tutorials/key-rotation</a></p>
<p dir="auto">If you decide on leveraging the endpoints (making a call to FusionAuth) for validation, here are a couple links that can be used depending on your scenario.</p>
<p dir="auto"><a href="https://fusionauth.io/docs/v1/tech/apis/jwt#validate-a-jwt" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/apis/jwt#validate-a-jwt</a> (proprietary)<br />
<a href="https://fusionauth.io/docs/v1/tech/oauth/endpoints#userinfo" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/oauth/endpoints#userinfo</a> (part of the OIDC standard)</p>
<p dir="auto">In both cases, you must validate the claims. Some are standard, as outlined here: <a href="https://fusionauth.io/learn/expert-advice/tokens/anatomy-of-jwt#claims-to-verify" rel="nofollow ugc">https://fusionauth.io/learn/expert-advice/tokens/anatomy-of-jwt#claims-to-verify</a></p>
<p dir="auto">But there may be app specific custom claims your code should verify too.</p>
]]></description><link>https://fusionauth.io/community/forum/post/5248</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/5248</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Mon, 13 Jun 2022 23:35:03 GMT</pubDate></item></channel></rss>