
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
- CORS errors with storage bucket
I have a javascript file in the storage bucket and I used the view endpoint in an `src` attribute of a `<script>` tag. But I am getting the `net::ERR_BLOCKED_BY...
- Oauth2-Error 400Invalid `success` param:...
My code: > await new Account(client).createOAuth2Session(OAuthProvider.Google, 'https://www.mydomain.online/home', 'https://www.mydomain.online'); I ha...
- Issue with Appwrite Function Execution –...
Hi all, I'm encountering an issue when calling an Appwrite function from my Flutter app. **Environment:** ```Flutter SDK: 3.27.3 Appwrite Flutter SDK: 16.1.0```...
