Skip to content

Commit 01ed4e7

Browse files
committed
idp
1 parent 2e0196f commit 01ed4e7

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

docs/advanced-usage/authentication.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ You can revoke a token by calling the `POST /api/auth/revoke` endpoint with your
3333

3434
Setting up single sign-on (SSO) using OAuth2 authentication for GameVault requires an identity provider (e.g. Google, Authelia, Keycloak, Microsoft, Discord, etc.).
3535

36+
Currently only one identity provider is supportet at a time.
37+
3638
### Steps
3739

3840
1. Enable OAuth2 authentication in your [configuration](../server-docs/configuration.md#auth).
@@ -52,6 +54,31 @@ Setting up single sign-on (SSO) using OAuth2 authentication for GameVault requir
5254

5355
7. Authentication is now complete. Use the provided access token for authenticated requests to the GameVault API.
5456

57+
### Examples
58+
59+
You can find working example configurations for popular identity providers below to get an idea of how to set them up.
60+
61+
#### Google
62+
63+
```env
64+
AUTH_OAUTH2_CLIENT_ID=XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com
65+
AUTH_OAUTH2_CLIENT_SECRET=XXXXXX-XXXXXXXXXXXX-XXXXXXXXXXXX
66+
AUTH_OAUTH2_AUTH_URL=https://accounts.google.com/o/oauth2/v2/auth
67+
AUTH_OAUTH2_TOKEN_URL=https://oauth2.googleapis.com/token
68+
AUTH_OAUTH2_USERINFO_URL=https://www.googleapis.com/oauth2/v3/userinfo
69+
```
70+
71+
#### Discord
72+
73+
```env
74+
AUTH_OAUTH2_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXX
75+
AUTH_OAUTH2_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
76+
AUTH_OAUTH2_AUTH_URL=https://discord.com/oauth2/authorize
77+
AUTH_OAUTH2_TOKEN_URL=https://discord.com/api/oauth2/token
78+
AUTH_OAUTH2_SCOPES=openid,email,identify
79+
AUTH_OAUTH2_USERINFO_URL=https://discord.com/api/users/@me
80+
```
81+
5582
### Debugging OAuth2 Authentication
5683

5784
- Set the environment variable `SERVER_LOG_LEVEL` environment variable to `debug` to receive detailed logs about the authentication process.

0 commit comments

Comments
 (0)