Skip to content

Commit c96e779

Browse files
committed
Add oauth details to docs
1 parent 114cd0a commit c96e779

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/oauth2.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,27 @@ PUBLIC_OAUTH_CLIENT_NAME=github
1313
```
1414

1515
This variable has to match the client name defined in fractal-server configuration.
16+
17+
18+
## Full details for local example
19+
20+
1. Register an OAuth2 app on GitHub with _Homepage URL_ http://127.0.0.1:5173 and _Authorization callback URL_ http://127.0.0.1:5173/auth/login/oauth2/.
21+
2. Set up the following env variables for fractal-server:
22+
```
23+
OAUTH_GITHUB_CLIENT_ID=...
24+
OAUTH_GITHUB_CLIENT_SECRET=...
25+
OAUTH_GITHUB_REDIRECT_URL=http://127.0.0.1:5173/auth/login/oauth2/
26+
# [all other variables]
27+
```
28+
3. Set up the following env variables for fractal-web:
29+
```
30+
FRACTAL_SERVER_HOST=http://127.0.0.1:8000
31+
AUTH_COOKIE_DOMAIN=127.0.0.1
32+
PUBLIC_OAUTH_CLIENT_NAME=github
33+
# [all other variables]
34+
```
35+
36+
> A typical gotcha: if there is a mismatch between the cookie domain and the
37+
> URL you are using (e.g. one points to localhost and the other one to
38+
> 127.0.0.1), then the cookie won't be set and this will fail silently,
39+
> therefore likely triggering other unexpected behaviors.

0 commit comments

Comments
 (0)