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

GitHub oAuth Connection #5

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

GitHub oAuth Connection #5

BehrRiley opened this issue Feb 16, 2024 · 0 comments
Assignees
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>//github.com/login/oauth/authorize
i think we need our authorization?

- definemap headers:
      Authorization: <secret[github_api_token]>
      User-Agent: B
      Content-Type: Application/json
- define uuid <util.random.duuid>
- definemap data:
    client_id: <secret[github_client_id]>
    redirect_uri: https<&co>//api.behr.dev/github_oauth
    scopes:
    - public_repo
    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://github.com/login/oauth/access_token;
check with:
<entry[response].result.parse_yaml.get[code].if_null[null]>
redirect token back with:

- definemap data:
    client_id: <secret[github_client_id]>
    client_secret: <secret[github_client_secret]>
    code: <[code]>
    redirect_uri: https<&co>//api.behr.dev/github_oauth

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

From here we can use the public_repo scope to fork the relevant repositories and star the others
the https://api.github.com/user endpoint will tell us what repositories they have to skip the forking process

@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
@BehrRiley BehrRiley self-assigned this 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