Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord oAuth Connection (Draft) #6

Open
BehrRiley opened this issue Feb 16, 2024 · 0 comments
Open

Discord oAuth Connection (Draft) #6

BehrRiley opened this issue Feb 16, 2024 · 0 comments
Labels
📜Command Discord or in-game command ⬆️Feature Request Specific addition or interest for improvement 📄Research No evident fix is presently available or research needs to be done here. 📄To-Do Something that needs done

Comments

@BehrRiley
Copy link
Member

BehrRiley commented Feb 16, 2024

Authorizing

In reference to documentation:

Initiate authorization

Request details:
- define url https<&co>//discord.com/oauth2/authorize
i think we need our authorization?

- definemap headers:
      Authorization: <secret[cbot]>
      User-Agent: B
      Content-Type: Application/json
- define uuid <util.random.duuid>
- definemap data:
    client_id: <secret[discord_client_id]>
    redirect_uri: https<&co>//api.behr.dev/oAuth/Discord
    scopes:
      # required for name
    - identify
      # good for players to serve an invite if theyre not already in b
    - guilds
      # helpful for checking the user's role in Minecraft server's Discord guilds; great for developers
    - guilds.members.read
    state: <[uuid]>

- ~webget <[url]> headers:<[headers]> data:<[data].to_json> save:response method:get

Redirect token

use <entry[response].result.parse_yaml.get[code]> to find the code access token, and then post it to:
- define url https<&co>//discord.com/api/oauth2/token;
check with:
<entry[response].result.parse_yaml.get[code].if_null[null]>
redirect token back with:

- definemap data:
    grant_type: authorization_code
    code: <[code]>
    redirect_uri: https<&co>//api.behr.dev/discord_oauth

- ~webget <[url]> headers:<[headers]> data:<[data].to_json> save:response method:get

@BehrRiley BehrRiley added ⬆️Feature Request Specific addition or interest for improvement 📄Research No evident fix is presently available or research needs to be done here. 📄To-Do Something that needs done 📜Command Discord or in-game command labels Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📜Command Discord or in-game command ⬆️Feature Request Specific addition or interest for improvement 📄Research No evident fix is presently available or research needs to be done here. 📄To-Do Something that needs done
Projects
None yet
Development

No branches or pull requests

1 participant