Appearance
Hugging Face authentication
Hugging Face authentication lets your users sign in with the Hugging Face account they already use for AI tools and communities.
What this integration supports (optional)
- Social sign in with Hugging Face
- Redirect to different pages for success, error, and first-time users
Setup in the Hugging Face dashboard
- Go to the Hugging Face settings for your account or organization.
- Create a new OAuth application (or an equivalent app configuration).
- Add a redirect URL (the URL Hugging Face sends users back to after login).
- Use the WeWeb callback URL: the address of your app followed by
/api/auth/callback/huggingface. The table below lists the URLs to add.
- Use the WeWeb callback URL: the address of your app followed by
- Copy the credentials Hugging Face provides (for example
Client IDandClient Secret).
Add one callback URL for each place where users sign in:
| Where users sign in | Callback URL to add in Hugging Face |
|---|---|
| Editor | https://<your-project>-editor.weweb.io/api/auth/callback/huggingface |
| Staging app | https://<your-project>-staging.weweb.io/api/auth/callback/huggingface |
| Published app | https://<your-project>-production.weweb.io/api/auth/callback/huggingface |
| Custom domain | https://your-domain.com/api/auth/callback/huggingface |
Replace <your-project> with your project's WeWeb subdomain. You can see it in your browser's address bar when the editor is open, for example bright-harbor in https://bright-harbor-editor.weweb.io.
CALLBACK URL VS SUCCESS PAGE
Hugging Face always sends users back to the callback URL, never to a page of your app. WeWeb then completes sign in and takes users to the Success Page, Error Page, or New User Page you choose in the Sign in with social provider action. Do not add the URL of these pages in Hugging Face.
Connect Hugging Face in WeWeb
- In the WeWeb editor, open the
Data & APItab, then open theAuthenticationsubtab and go toSSO Providers. - Select
Hugging Faceand turn on theEnabletoggle. - Paste the values from Hugging Face into the fields shown in WeWeb.
- Click
Save.
Test sign in
- In
Interface, add a “Continue with Hugging Face” button. - Create a workflow on click and add
Sign in with social provider. - Set:
Provider:Hugging Face(valuehuggingfaceif you bind it)Success Page,Error Page, and (optional)New User Page
- Preview your app and complete the sign-in flow.
For details about sessions, roles, and protecting pages and data after sign in, see the shared auth docs.
Common pitfalls
Redirect URL mismatch
If Hugging Face rejects the login with a redirect error:
- Confirm the redirect URL in Hugging Face exactly matches the WeWeb callback URL ending with
/api/auth/callback/huggingface(no trailing slash), not theSuccess PageURL you selected in WeWeb. - Make sure you’re testing the same environment (editor, staging app, published app, or custom domain) you configured.
Reference
Settings
| Setting in WeWeb | Description | Where to find it in Hugging Face |
|---|---|---|
Client ID | Identifies your Hugging Face app. | In your OAuth app configuration. |
Client Secret | Used to complete the sign-in flow securely. | In your OAuth app configuration. |
FAQs
Which redirect URL should I add in Hugging Face?
Add the address of your app followed by /api/auth/callback/huggingface, for example https://your-domain.com/api/auth/callback/huggingface. Add one for each place where users sign in (editor, staging app, published app, custom domain). The URL of your Success Page is not the redirect URL.

