Discord Oauth2 with NiceGUI
A simple Discord Login using NiceGUI and Zenora.
Head to Discord Developer Portal and create a new application. After creating the app, go to OAuth2 tab. Get ClientID, Client Secret from there (we'll need those later).
- Head to Bot Tab and reset the Token (save the Token for later, we'll need it as well).
- Set Redirects to http://localhost:8000/oauth/callback (8000 port for Native, 8080 for Web)
- Set the default auth link to the redirect we've just created.
- Now head to URL Generator under OAuth2 tab. Select the scopes that your web/standalone application needs.
- Select the Redirect Link as the one we've set before.
- Copy the Generated URL, we'll need this later as well.
pip install nicegui
pip install Zenora
Zenora Discord REST API in Python (Read More)
- Open the config (CONFIG PY file):
- TOKEN : Discord Bot Token
- CLIENT_SECRET: Discord App Token
- REDIRECT_URL: The one we set in Discord Dev Portal (Remember 8000 Port for Native, 8080 for Web)
- OAUTH_URL: From the 0Auth2 URL Generator