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:
After clicking this button your users will be presented with a permissions modal to authorize your app:
You can create your application in your settings:
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.
The currently supported scopes are:
openid
: Get the ID token in addition to the access token.profile
: Get the user’s profile information (username, avatar, etc.)email
: Get the user’s email address.read-repos
: Get read access to the user’s personal repos.write-repos
: Get write access to the user’s personal repos. Does not grant read access on its own, you need to include read-repos
as well.manage-repos
: Get access to a repo’s settings. Also grants repo creation and deletion.inference-api
: Get access to the Inference API, you will be able to make inference requests on behalf of the user.All other information is available in the OpenID metadata.
Please contact us if you need any extra scopes.
You are free to use your own design for the button. Below are some SVG images helpfully provided.
Check out our badges with explanations for integrating them in markdown or HTML.