Code Monkey home page Code Monkey logo

discord-auth-example's Introduction

discord-auth-example

simple example of discord authorization (login with discord) , with express

Introduction

guys, here I just give a simple example,
I use the Android platform, with the aim of being like iOS, desktop
You can make sure this file runs well
There are many ways that can be used to create Discord authorization
for example on the page another example.
but back again to my goal, creating a file like this I hope you all like it
thank you and good luck trying it


About

Maybe most Discord bot developers need a dashboard, and need several other needs such as creating a website for their bot,However, they also need permission to access photos, IDs and names from the Discord account they use, or other things such as requiring guild access, email or whatever depending on their goals.


Example

Installation

    required
    • nodejs v16 or the latest version
    • express
    • axios
    • node-fetch
    automatic installation
    git clone

    clone this project with an example like this on your terminal
    git clone https://github.com/Drnk-28/discord-auth-example.git

    after that, you can manage everything starting from this
    after that run it with node . on your terminal

    manual installation
    download repository

    You can download this repository on the main page of this repository
    After that, you can paste all the files in it into your file editor, and don't forget to fill in everything you need in the settings section.
    After that, you can run the file with node . in your terminal

Settings

    env-example
    clientId=
    clientSecret=
    redirectURL=

    You can get your clientId and clientSecret on the discord developer portal website, there you must have an application, and if there is no application yet, you need to create one first. if so, you just need to select the application and go to the OAuth2 menu, and select the general page, and do the same as in the screenshot below Example 1
    for the redirectURL= you can fill it with https://localhost:3000/login or with https://yourcoolwebsite.domain/login

    authorization

    the file below is located in home.ejs

    <a href="Your authorization link is here" class="login">Login<span></span><i class="bx bx-rocket"></i></a>

    You can get the authorization link from the Discord developer portal website, it is located in the OAuth2 menu, on the URL Generator page do exactly the same as the example below Example 2


Once you feel like everything is finished or you don't need anything else, you can try it by pressing the link https://localhost:3000/

Credits

Screenshot

Home

Authorization

Result

discord-auth-example's People

Contributors

drnk-28 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.