Option 1: Leverage NextAuth
If you are using Next.js, you can easilyintegrate the NextAuth library with Dynamic to perform server-side verification and then use a session client-side.
Option 2: Leverage Passport.js
We offer an official passport-dynamic extension.Option 3: Do-It-Yourself Verification
- Get the JWT through the Dynamic client’s
auth.tokenproperty. - Send the authToken to the server as a Bearer token
React Native
- Install the node-jsonwebtoken and jwks-rsa packages on your server
- Validate the JWT on your server using the same approach as React (see React tab for server-side validation code)