Integrating your authentication provider with Dynamic
After configuring the settings, you can “sign-in” with a non-Dynamic JWT token by calling the appropriate method for your platform.You can use the signInWithExternalJwt method from the useExternalAuth hook.
React
Copy
Ask AI
const { signInWithExternalJwt } = useExternalAuth();try { // `externalUserId`: User ID in the external auth system // `externalJwt`: Raw encoded JWT issued by external auth system const userProfile = await signInWithExternalJwt({ externalUserId, externalJwt }); if (userProfile) { // You should be logged in at this point }} catch (e: any) { console.error('Dynamic login failed:', e);}
After this point, you can use the Dynamic SDK to access the user’s profile and other data, just as you would with any other user.