Skip to content

Commit

Permalink
more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-c committed Sep 8, 2023
1 parent a07d24c commit 321dd68
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
25 changes: 24 additions & 1 deletion docs/hub/oauth.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# Sign in with Hugging Face

Besides [Spaces](https://huggingface.co/docs/hub/spaces-oauth), it's also possible to create an OAuth / OpenID connect app for your website. This will allow users to sign in to your website using their HF account.
You can use the HF OAuth / OpenID connect flow to create a **"Sign in with HF"** flow in any website or App.

This will allow users to sign in to your website or app using their HF account, by clicking a button similar to this one:

![Sign in with Hugging Face](https://huggingface.co/datasets/huggingface/badges/raw/main/sign-in-with-huggingface-xl-dark.svg)

After clicking this button your users will be presented with a permissions modal to authorize your app:

![](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/oauth-accept-application.png)

### If you are hosting in Spaces

<Tip>

If you host your app on Spaces, then the flow will be even easier to implement (and built-in to Gradio directly); Check our [Spaces OAuth guide](https://huggingface.co/docs/hub/spaces-oauth).

</Tip>

## Currently supported scopes

The currently supported scopes are:

Expand All @@ -12,6 +30,11 @@ Contact us at [[email protected]](mailto:[email protected]) with the d

All other information is available in the [OpenID metadata](https://huggingface.co/.well-known/openid-configuration).

<Tip warning={true}>
Please contact us if you need any extra scope. For example, we are thinking about how to provide access to a user access token, to read or write repos.
</Tip>


## Branding

You are free to use your own design for the button. Below are some SVG images helpfully provided.
Expand Down
8 changes: 7 additions & 1 deletion docs/hub/spaces-oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ This enables new use cases for your Space. For instance, when combined with [Per

<Tip>

This guide will take you through the process of integrating a *Sign-In with HF* button into any Space. If you're seeking a fast and simple method to implement this in a Gradio Space, take a look at its [built-in integration](https://www.gradio.app/guides/sharing-your-app#o-auth-login-via-hugging-face).
This guide will take you through the process of integrating a *Sign-In with HF* button into any Space. If you're seeking a fast and simple method to implement this in a **Gradio** Space, take a look at its [built-in integration](https://www.gradio.app/guides/sharing-your-app#o-auth-login-via-hugging-face).

</Tip>

<Tip>

You can also use the HF OAuth flow to create a "Sign in with HF" flow in any website or App, outside of Spaces. [Read our general OAuth page](./oauth).

</Tip>

Expand Down

0 comments on commit 321dd68

Please sign in to comment.