GitHub
Register a GitHub App
The GitHub administrator registers a GitHub App in GitHub. They will need the Posit Connect redirect URL which is defined as https://connect.example.org/__oauth__/integrations/callback
Replace connect.example.org
with the address of the Connect server.
The Connect Administrator must obtain the client ID and client secret from the GitHub administrator. The client ID can be found under Settings > Developer settings > GitHub Apps >
GitHub requires Confidential authentication. Public Viewer OAuth integrations are not supported.
The GitHub administrator will control the level of access through granular Repository, Organization, and Account settings. Unlike other OAuth integrations GitHub disregards all received scopes. Further restricting access by repository_id
is not supported within Connect itself but can be implemented within the content hosted on Connect. See the R Shiny GitHub Integration for details on how to request resources from a specific repository.
Transfer information to Connect administrator
The GitHub administrator shares the following information with the Posit Connect administrator:
Field | Description |
---|---|
client_id |
The unique identifier of the GitHub App. |
client_secret |
The secret string used to authenticate against the GitHub App. |
Create OAuth integration in Posit Connect
The Posit Connect administrator creates an OAuth integration through the Integrations tab on the Connect dashboard. Once the OAuth integration has been created in Connect, it is available for use by all publishers.
Alternatively, the example below shows how to create a GitHub OAuth integration using curl
and the Connect Server API.
Replace connect.example.org
with the address of the Connect server.
Terminal
curl -H "Authorization: Key ${CONNECT_API_KEY}" \
-XPOST https://connect.example.org/__api__/v1/oauth/integrations \
--data '{
"template": "github",
"name": "GitHub Application",
"description": "A helpful description for publishers to use when choosing an OAuth integration for their content.",
"config": {
"client_id": "<client-id>",
"client_secret": "<client-secret>",
"auth_mode": "Confidential"
}
}'
# 200 OK
# {"guid": "<oauth-integration-guid>", ... }