SSO Invalid Provider

Hello,
I’m configuring SSO for a project using Better Auth (following the documentation: https://www.better-auth.com/docs/plugins/sso
).
After the user logs in via SSO, the callback fails with the following error:
Error Code: invalid_provider
Error Description: token_response_not_found

My provider configuration:

providerId: azure

OIDC issuer, clientId, clientSecret, endpoints set according to Azure AD

Mapping: { id: 'oid', email: 'email', emailVerified: 'email_verified', name: 'name', image: 'picture' }

The redirect URI in Azure matches the expected callback path (/api/auth/sso/callback/azure).

I’ve checked that the provider registration succeeds and the server is running with the SSO plugin enabled.

Could you help me understand why Better Auth fails to recognize the provider at callback?
image.png
Integrate Single Sign-On (SSO) with your application.
Solution
There was a incorrect configuration of my app
Was this page helpful?