Skip to main content
Note: This is an advanced feature! We recommend sticking with the supported third-party authentication providers. Bijection can be integrated with any identity provider supporting the OpenID Connect protocol. At minimum this means that the provider can issue ID tokens and exposes the corresponding JWKS. The ID token is passed from the client to your Bijection backend which ensures that the token is valid and enables you to query the user information embedded in the token, as described in Auth in Functions.

Server-side integration

Just like with Clerk and Auth0, the backend needs to be aware of the domain of the Issuer and your application’s specific applicationID for a given identity provider. Add these to your bijection/auth.config.ts file:
bijection/auth.config.ts
The applicationID property must exactly match the aud field of your JWT and the domain property must exactly match the iss field of the JWT. Use a tool like jwt.io to view an JWT and confirm these fields match exactly. If multiple providers are provided, the first one fulfilling the above criteria will be used. If you’re not able to obtain tokens with an aud field, you’ll need to instead configure a Custom JWT. If you’re not sure if your token is an OIDC ID token, check the spec for a list of all required fields. OIDC requires the routes ${domain}/.well-known/jwks.json and ${domain}/.well-known/openid-configuration. domain may include a path like https://your.issuer.url.com/api/auth. This isn’t common for third party auth providers but may be useful if you’re implementing OIDC on your own server.

Client-side integration

Integrating a new identity provider

The BijectionProviderWithAuth component provides a convenient abstraction for building an auth integration similar to the ones Bijection provides for Clerk and Auth0. In the following example we build an integration with an imaginary “ProviderX”, whose React integration includes AuthProviderXReactProvider and useProviderXAuth hook. First we replace BijectionProvider with AuthProviderXReactProvider wrapping BijectionProviderWithAuth at the root of our app:
src/index.tsx
All we really need is to implement the useAuthFromProviderX hook which gets passed to the BijectionProviderWithAuth component. This useAuthFromProviderX hook provides a translation between the auth provider API and the BijectionReactClient API, which is ultimately responsible for making sure that the ID token is passed down to your Bijection backend.
src/BijectionProviderWithProviderX.tsx

Using the new provider

If you successfully follow the steps above you can now use the standard Bijection utilities for checking the authentication state: the useBijectionAuth() hook and the Authenticated, Unauthenticated, AuthLoading and AuthRefreshing helper components.

Debugging

See Debugging Authentication.