Overview
This guide outlines the steps to configure OAuth2 authentication for the GitHub integration in your CDCM application.
This document will walk you through:
Creating a GitHub OAuth App
Configuring CDCM connection routing
Testing the integration
By following these instructions, you'll enable your users to seamlessly connect their GitHub accounts and access their repositories within CDCM.
Create OAuth application in Github
Find Developer Settings: Locate the "Developer settings" link in the sidebar menu.
Access OAuth Apps: Navigate to the "OAuth Apps" section under the "GitHub Apps" menu.
Create New OAuth App: Click the "New OAuth App" button to begin the process of registering a new OAuth application.
Configure OAuth App Details: Fill out the required fields:
Application name: "CDCM - Productive" (something users will recognize)
Homepage URL: Something like"https://your.cdcm.instance.com" (the root URL for your CDCM instance)
Authorization callback URL: "https://your.cdcm.instance.com/external-login/oauth2-redirect/cdcm-github" (the CDCM instance URL plus the correct redirect path and a unique connection ID, see below for details)
Optionally, provide an Application description.
Register the Application: Click the "Register application" button to complete the process.
Generate a new client secret: After the application is registered you get a client ID and can create a client secret. You will need both when you configure connection routing in cdcm.
Make sure to set the Authorization callback URL correctly:
The format for the Authorization callback URL should be:
<your_cdcm_instance_url>/external-login/oauth2-redirect/<connection_id>
Where:
<your_cdcm_instance_url>
is the root URL of your CDCM instance (e.g.,https://your.cdcm.instance.com
)<connection_id>
is a unique identifier for the connection between your CDCM app and the GitHub OAuth app (e.g.,cdcm-github
)
The external-login/oauth2-redirect/
part of the URL is a predefined path that your CDCM application is expecting the GitHub OAuth flow to redirect to after a successful authentication.
Connection routing
After the oauth application was registered in github the connection routing configuration yml can be updated.
Add a new section under
connection-routing
thecdcm-connection-id
value has to be the same that was used as part of the authorization callback url above.
- cdcm-connection-id: cdcm-github methods: ALL root-uris: - https://api.github.com/**
Add a new section under
connections
. Use theclient-id
andclient-secret
from the oauth app registered in GitHub.
cdcm-github: connection-type: OAUTH20 client-id: dGhpcyBpcyBhIGlk client-secret: SGVsbG8gZnJpZW5kIDop user-info-uri: https://api.github.com/user scopes: read:user, repo authorization-uri: https://github.com/login/oauth/authorize token-uri: https://github.com/login/oauth/access_token
0 Comments