Skip to content

Commit

Permalink
📝 Remove need for hf_oauth_redirect_path (#1163)
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 authored Dec 15, 2023
1 parent 939febb commit ae62884
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
3 changes: 0 additions & 3 deletions docs/hub/spaces-config-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ Whether the Space stays on top of your profile. Can be useful if you have a lot
**`hf_oauth`** : _boolean_
Whether a connected OAuth app is associated to this Space. See [Adding a Sign-In with HF button to your Space](https://huggingface.co/docs/hub/spaces-oauth) for more details.

**`hf_oauth_redirect_path`** : _string_
Authorized relative redirect path of the connected OAuth app. `/login/callback` and `/auth/callback` are authorized by default and do not need this parameter. See [Adding a Sign-In with HF button to your space](https://huggingface.co/docs/hub/spaces-oauth) for more details.

**`hf_oauth_scopes`** : _List[string]_
Authorized scopes of the connected OAuth app. `openid` and `profile` are authorized by default and do not need this parameter. See [Adding a Sign-In with HF button to your space](https://huggingface.co/docs/hub/spaces-oauth) for more details.

Expand Down
11 changes: 3 additions & 8 deletions docs/hub/spaces-oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ python_version: 3.10.6
app_file: app.py

hf_oauth: true
# optional, see "Redirect URLs" below
hf_oauth_redirect_path: /custom_callback_route
# optional, see "Scopes" below. "openid profile" is always included.
hf_oauth_scopes:
- read-repos
Expand All @@ -56,14 +54,11 @@ As for any other environment variable, you can use them in your code by using `o

## Redirect URLs

The allowed redirect URIs for your OAuth app are:
You can use any redirect URL you want, as long as it targets your Space.

- `https://{SPACE_HOST}/auth/callback`
- `https://{SPACE_HOST}/login/callback`
Note that `SPACE_HOST` is [available](https://huggingface.co/docs/hub/spaces-overview#helper-environment-variables) as an environment variable.

Note that `SPACE_HOST` is also [available](https://huggingface.co/docs/hub/spaces-overview#helper-environment-variables) as an environment variable.

You can add a custom relative redirect path by setting `hf_oauth_redirect_path` in your Space's metadata.
For example, you can use `https://{SPACE_HOST}/login/callback` as a redirect URI.

## Scopes

Expand Down

0 comments on commit ae62884

Please sign in to comment.