Module Github.URI

The URI module contains URI generation functions which may be useful for linking on the Web or passing to other GitHub API clients.

val authorizations : Uri.t

The API endpoint for creating and retrieving authorizations.

val authorize : ?⁠scopes:Github_t.scope list ‑> ?⁠redirect_uri:Uri.t ‑> client_id:string ‑> state:string ‑> unit ‑> Uri.t

authorize ?scopes ?redirect_uri ~client_id ~state () is the URL to redirect users to in an OAuth2 flow to create an authorization token. ?redirect_url is the URL in your Web application where users will be sent after authorization. If omitted, it will default to the callback URL in GitHub's OAuth application settings. The state parameter should match the callback state parameter in order to protect against CSRF.

val token : client_id:string ‑> client_secret:string ‑> code:string ‑> unit ‑> Uri.t

token ~client_id ~client_secret ~code () is the API endpoint used by Token.of_code to finish the OAuth2 web flow and convert a temporary OAuth code into a real API access token.