goauthentik / goauthentik/authentik

sources/oauth/discord: Allow changing Discord API URLs

Open
#18,055 0 comments 0 reactions 0 assignees View on GitHub
enhancement enhancement/confirmed
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 2h
Merged PRs (30d)
659

Description

# Feature Request: Configurable Discord API URLs for Auth Source

## Is your feature request related to a problem? Please describe.
Currently, it is not possible to modify the Discord URLs used by the Discord Auth Source. Specifically, the `access_token_url` and `profile_url` endpoints are hardcoded, preventing users from routing requests through a proxy.

Proxies are widely used in larger Discord bots to avoid hitting rate limits. Without configurable URLs, users have to rely on fragile workarounds, which can lead to instability and higher maintenance overhead.

Some widely used Discord API proxies include:

- [Nirn Proxy](https://github.com/germanoeich/nirn-proxy)
- [Twilight HTTP Proxy](https://github.com/twilight-rs/http-proxy)
- [@discordjs/proxy](https://github.com/discordjs/discord.js/tree/main/packages/proxy)

---

## Describe the solution you'd like
I would like the Discord Auth Source to allow configuring the following URLs:

- `access_token_url`
- `profile_url`

For example:

- **Access Token URL**: `https://my-proxy.proxy.svc.cluster.local:8080/api/oauth2/token`
- **Profile URL**: `https://my-proxy.proxy.svc.cluster.local:8080/api/users/@me`

Currently, setting `urls_customizable = True` works locally, but it exposes many other fields unrelated to Discord, which can confuse users. Ideally, only `access_token_url` and `profile_url` should be customizable, while `authorization_url` should remain fixed, since users always need to be redirected to Discord for authentication.

---

## Describe alternatives you've considered
One alternative is modifying DNS or `/etc/hosts` in the container to point `discord.com` to the proxy. This approach is hacky, error-prone, and hard to maintain across environments.

Properly configurable URLs would provide a clean, maintainable solution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.