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
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...
- 500 Server error
getting same 500 status This is my appwrite project: https://cloud.appwrite.io/console/project-fra-691932db0036241caa0e/overview/platforms Help how to open th...