I'm trying to integrate Appwrite authentication with Convex backend. I believe that Convex requires an OpenID Connect ID tokens, but I can't find a way to get an OIDC-compliant ID token from Appwrite.
Current Setup: -- Successfully authenticating with Appwrite -- Can get JWT tokens from Appwrite -- Need to pass these to Convex Current Appwrite JWT format:
{
sub: '67881a4942568fc06e77',
iss: 'https://cloud.appwrite.io/v1',
aud: '672d1490001071c7b24b',
iat: 1736994725,
exp: 1736998325
}
Code:
// src/components/providers/auth-provider.tsx
export function useAuthFromAppwrite() {
const fetchAccessToken = useCallback(async ({ forceRefreshToken }: { forceRefreshToken: boolean }) => {
try {
const { jwt } = await account.createJWT();
return jwt;
} catch (error) {
console.error("Token creation failed:", error);
return null;
}
}, []);
return {
isLoading: false,
isAuthenticated: true,
fetchAccessToken
};
}
error from Convex:
Failed to authenticate: "Could not parse as id token", check your server auth config
Does Appwrite support generating OpenID Connect ID tokens?
It's a React based app and I do have part of the project (API's, Database) working in Appwrite. Looking to migrate but need interim solution until I can get the rest migrated over.
Recommended threads
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.
- Download appwrite Docs
Is there is a way to download appwrite Docs ? Because appwrite skill isn't enough to give the agent full understanding about how appwrite works (I noticed this ...