Generating a Personal Access Token
Create a Personal Access Token to enable API access with your GitHub account.
Access Developer Settings
Sign in to your GitHub account and navigate to developer settings.
- Click your profile photo in the upper-right corner
- Select Settings from the dropdown
- In the left sidebar, scroll down and click Developer settings
Navigate to Personal Access Tokens
Access the Personal Access Tokens settings.
- In the left sidebar, click Personal access tokens
- Select Tokens (classic) from the dropdown
Generate New Token
Create a new classic personal access token.
- Click the Generate new token dropdown
- Select Generate new token (classic)
- Enter a descriptive Note for the token (e.g., StackOne Integration)
Set Token Expiration
Configure the token expiration period.
- Select No expiration from the Expiration dropdown for long-term use
- Note: For security, consider using a shorter expiration period and rotating tokens regularly
Select Required Scopes
Choose the appropriate Classic OAuth scopes for your integration needs. The scopes below match the exact structure and grouping from GitHub’s token creation page.
Scopes for access reviews and compliance checks
read:org lists members and teams, two-factor status when the token’s user owns the organization, and the organization audit log for an owner. admin:org adds pending invitations, the organization’s two-factor requirement and organization rulesets. repo reads private repositories, pull requests, reviews, branch protection and collaborators. read:audit_log reads the enterprise audit log for an enterprise owner.
Generate and Copy Token
Complete the token generation and store it securely.
- Scroll to the bottom and click Generate token
- Copy the displayed token immediately and store it securely
- Warning: The token is shown only once and cannot be retrieved later
- Format:
ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Authorize the token for single sign-on
If your organization uses SAML single sign-on, GitHub refuses its requests with 403 until the token is authorized for it.
- Go to Settings > Developer settings > Personal access tokens > Tokens (classic)
- Next to the token, click Configure SSO, then Authorize next to the organization
Connecting a GitHub Enterprise Cloud enterprise
Fill in Enterprise slug to list every licensed user in the enterprise across all its organizations. Leave it empty to list one organization at a time.
Create the token as an enterprise owner
An enterprise owner creates a classic token with the steps above. GitHub Apps cannot read the enterprise’s users, so this needs the token connection.
- Enterprise Managed Users: sign in through your identity provider as a managed enterprise owner (username ending in
_<shortcode>). Do not use the<shortcode>_adminsetup user - To read an organization’s members, teams and settings, the token’s user must also be an owner of that organization. An enterprise owner who is not a member of an organization does not see it
Select the read-only scopes
In the enterprise list, someone whose only tie is a pending organization invitation shows as pending. Add admin:org only if you also list single organizations and want all their pending invitations.
Authorize the token for single sign-on
If your enterprise or organizations use SAML or OIDC single sign-on, including Enterprise Managed Users, authorize the token. Until then GitHub refuses organization requests.
- Go to Settings > Developer settings > Personal access tokens > Tokens (classic)
- Next to the token, click Configure SSO, then Authorize for your enterprise or each organization
Enter the enterprise
In Enterprise slug, enter the last part of https://github.com/enterprises/<enterprise slug>.
- A user appears once they sign in or join an organization. Enterprise members who never signed in and belong to no organization are not listed
- Enterprise Managed Users: two-factor status shows as unknown and email addresses are empty, because sign-in and email are managed in your identity provider
Check enterprise policies
Confirm nothing blocks the connection.
- If the enterprise restricts classic tokens (Policies > Personal access tokens), allow them for the connecting owner
- If an IP allow list is on (Settings > Authentication security), add StackOne’s IP addresses
Linking the Account from the Hub
Navigate to the Hub
Fill out the fields
- Personal Access Token
- Organization ID (Optional)
- Enterprise slug (Optional)
Connect
- Click Connect
- If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider’s authorization flow.
- Once authorization is successful, you will see a confirmation popup
If the account linking is successful, you will see the newly linked account in your Accounts page.
Next Steps
Webhooks setup
Configure receiving Events for GitHub into StackOne.