FlynV / NiceGUI-Discord-Oauth2

A simple login/logout using Zenora Lib, Discord Oauth2 and NiceGUI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discord Oauth2 with NiceGUI

Log in and out using Discord Oauth2 (Zenora) and NiceGUI.

A simple Discord Login using NiceGUI and Zenora.

Create Discord Application

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.

Required Libs

pip install nicegui

pip install Zenora

Zenora Discord REST API in Python (Read More)

Configuring Login (CONFIG PY)

  • 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

Run App (AUTH PY)

If all set right, we'll have a proper Login!

About

A simple login/logout using Zenora Lib, Discord Oauth2 and NiceGUI.

License:MIT License


Languages

Language:Python 100.0%