graphicsopf.blogg.se

Sign into discord with username
Sign into discord with username




sign into discord with username

Make sure the bot is a member of all servers in this list.

  • Populate config.json with a list of server IDs that you wish to check user roles for.
  • Generate a bot token and paste it into npx wrangler secret put DISCORD_TOKEN.
  • The bot does not need any permissions, it just needs to exist in the server.
  • Create a Discord Bot for the OAuth2 application, generate an OAuth2 URL with the bot scope and use it to invite the bot to your server.
  • Follow the above setup, making sure to use the /guilds auth URL.
  • See the Examples section below for help with constructing policies.
  • If the Auth URL is /guilds then the guilds claim can be used to provide a list of guild IDs.
  • Basically a safer form of global_name, which might sometimes be null.
  • name will map to the non-unique Display Name of the user, or username if there is none.
  • preferred_username will map to the users username and discrim if they have one e.g.
  • It would be recommended to add id here, as the users unique Discord user ID.
  • Email is included automatically without being set here.
  • Proof Key for Code Exchange (PKCE): Enabled.
  • Auth URL: or swap out /email for /guilds to include the Guilds scope.
  • Client secret: Your Discord application OAuth2 secret.
  • Navigate to Settings > Authentication, select "Add new" under Login methods, select OpenID Connect.
  • Go to the Cloudflare Zero Trust dashboard.
  • Publish the Worker with npx wrangler publish!.
  • sign into discord with username

    This should be the same URL you added to Discord.

  • Edit your Cloudflare Access subdomain into config.json under redirectURL.
  • Add your Discord application ID and OAuth2 secret to config.json.
  • sign into discord with username

    Edit wrangler.toml to use your new KV namespace ID.Create a KV namespace on Cloudflare here.Clone the repository and cd into it: git clone & cd discord-oidc-worker.Add a redirect URI to the Discord application.A Discord developer application to use for OAuth2.A Cloudflare Access account - make sure you've gone through the onboarding flow and have a subddomain.Some ideas were also taken from eidam/cf-access-workers-oidc. Process flow was inspired by kimcore/discord-oidc but rewritten entirely for Cloudflare Workers and Hono. Wraps OIDC around the Discord OAuth2 API to achieve this, storing signing keys in KV. Simply put: Allows you to authorise with Cloudflare Access using your Discord account via a Cloudflare Worker. Discord OIDC Provider for Cloudflare Access






    Sign into discord with username