Skip to content

Conversation

@michael-radency
Copy link
Contributor

Summary

extract hostname for authUrl and accessTokenUrl from server url

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-2963/community-issue-github-oauth-not-working-for-enterprise-server
closes #15326

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@michael-radency michael-radency added n8n team Authored by the n8n team node/issue Issue with a node labels May 20, 2025
@dana-gill dana-gill requested a review from RomanDavydchuk May 20, 2025 08:39
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic found 1 issue across 3 files. Review it in cubic.dev

type: 'hidden',
default:
'={{$self["server"] === "https://api.github.com" ? "https://github.com" : $self["server"]}}/login/oauth/authorize',
'={{$self["server"] === "https://api.github.com" ? "https://github.com" : "https://" + $self["server"].replace("https://", "").split("/")[0]}}/login/oauth/authorize',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL parsing doesn't handle HTTP protocol or URLs without protocol prefix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-radency should this handle the case when it's HTTP, or do we just assume it's always HTTPS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It's probably safe to assume, but not guaranteed - I'll update the expression

@codecov
Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

import { NodeTestHarness } from '@nodes-testing/node-test-harness';

describe('Test Github Oauth2 Credentials Expression', () => {
new NodeTestHarness().setupTests();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests fail locally: Your test suite must contain at least one test., I think you missed { workflowFiles: ['test.workflow.json'] } here

@shortstacked
Copy link
Contributor

Workflow Test Results 📊 ⚠️ 4 Warnings (0 Failed), 👍 79 Successful out of 83 total workflows.

View full workflow run

Tested Ref: 35bbb29d889869669e6780abf313ce1840635d6e by @RomanDavydchuk

⚠️ Warnings (4)

Workflow ID Workflow Name Reason
237 BasicLLMChain:AzureChat Workflow contains new data that previously did not exist.
35 Slack:User:getPresence info:UserProfile:get update... Workflow contains new data that previously did not exist.
257 Agent:auto-fix:anthropic Workflow contains new data that previously did not exist.
53 ConvertKit:CustomField:create getAll update delete... Workflow contains new data that previously did not exist.

@github-actions
Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

…community-issue-github-oauth-not-working-for-enterprise
@shortstacked
Copy link
Contributor

Workflow Test Results 📊 🔴 2 Failed, ⚠️ 2 Warnings, 👍 79 Successful out of 83 total workflows.

Detail: Workflows failing: 237: Workflow contains 1 deleted data. View full workflow run

Tested Ref: fa14a9c465bb703ea7538990c6978e382f59268f by @RomanDavydchuk

❌ Failed Tests (2)

Workflow ID Workflow Name Reason
237 BasicLLMChain:AzureChat Workflow contains 1 deleted data.
258 Agent:auto-fix:openai Workflow contains 2 deleted data.

⚠️ Warnings (2)

Workflow ID Workflow Name Reason
35 Slack:User:getPresence info:UserProfile:get update... Workflow contains new data that previously did not exist.
257 Agent:auto-fix:anthropic Workflow contains new data that previously did not exist.

@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

@RomanDavydchuk RomanDavydchuk merged commit bc66d9f into master May 29, 2025
13 checks passed
@RomanDavydchuk RomanDavydchuk deleted the node-2963-community-issue-github-oauth-not-working-for-enterprise branch May 29, 2025 09:33
@github-actions github-actions bot mentioned this pull request Jun 2, 2025
@janober
Copy link
Member

janober commented Jun 2, 2025

Got released with n8n@1.97.0

Alexandero89 pushed a commit to Alexandero89/n8n that referenced this pull request Jun 4, 2025
Alexandero89 pushed a commit to Alexandero89/n8n that referenced this pull request Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

n8n team Authored by the n8n team node/issue Issue with a node Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Github OAuth not working for enterprise server

5 participants