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
- Missing Invoice
Hi! I need help with billing on my account (marelu@gmail.com). I have never received a single invoice by email. My organization has been on the Pro plan since...
- Appwrite Functions cold start
Hello. I'm seeing really long cold starts on Appwrite Cloud Functions and wanted to know if this is expected. My function just authenticates the user, fetches ...
- Error can not create `tablesdb` event wi...
When i'm trying to add an event with `tablesdb` i get an error message My event value: `tablesdb.mtg-decklist-dev.tables.queue_parsing.rows.*.create` Same err...