cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

ENTERPRISE GITHUB: Custom Connector?

Anyone have success creating a custom connector to connect to an Enterprise Github instance? 

 

Here's my problem:

  • Enterprise Github access requires VPN
  • When my laptop is on VPN, I can send requests and receive data via Postman
    • Had to create a Personal Access Token in Enterprise Github
    • Place token in either URL or Request Header (both work in Postman)
  • I'm unable to send a successful request using a Custom Connector. 

Tried so far:

  • Passing Personal Access Token in URL and Request Header (status 500)
  • Connecting via On-prem Data Gateway and Windows credentials (to get onto the VPN even though the Github instance is cloud-based I think)
    • This results in the error: "Cannot leave gatway name null..."
  • Exporting Postman v1 Collection and importing as a Custom Connector (status 500)

Any ideas? Thanks!

4 REPLIES 4
Community Support Team
Community Support Team

Re: ENTERPRISE GITHUB: Custom Connector?

Hi @ericonline ,

Could you please share a bit more about your issue?

Could you please share a screenshot about your custom connector's configuration?

Have you taken a try to use Basic Authentication (Username & Password) as authentication way instead of Access Token?

 

Based on the issue that you mentioned, I have made a test on my side (Basic Authentication and Access Token), and don't have the issue that you mentioned.

 

Please check and see if the following article would help in your scenario:

https://docs.microsoft.com/en-us/connectors/custom-connectors/create-webhook-trigger#enable-authenti...

 

More details about creating a custom connector in PowerApps, please check the following video:

https://www.youtube.com/watch?v=dBCS1nPsDiE

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: ENTERPRISE GITHUB: Custom Connector?

Hi @v-xida-msft ,

Thanks for the reply. 

Postman details: 

- Laptop connection: Company VPN

- Method: GET

- Request URLhttps://github.myCompany.com/api/v3/users/myUsername/repos

- Authorization: NTLM Authentication (Beta)

  - Username: myUsername

  - Password: myPassword

  - Advanced:

    - Domain: xxx.xxx.myCompany.com

    - Workstation: myWorkstationName

- (Also works with) Authorization: OAUTH2.0

    - Access Token: Personal Access Token created in Github

- Response

[
    {
        "id": 5564,
        "name": "repoName",
        "full_name": "userName/repoName",
        "owner": {
            "login": "userName",
            "id": 1477,
            "avatar_url": "https://github.myCompany.com/avatars/u/1477?",
            "gravatar_id": "",
            "url": "https://github.myCompany.com/api/v3/users/userName",
            "html_url": "https://github.myCompany.com/userName",
            "followers_url": "https://github.myCompany.com/api/v3/users/userName/followers",
            "following_url": "https://github.myCompany.com/api/v3/users/userName/following{/other_user}",
            "gists_url": "https://github.myCompany.com/api/v3/users/userName/gists{/gist_id}",
            "starred_url": "https://github.myCompany.com/api/v3/users/userName/starred{/owner}{/repo}",
            "subscriptions_url": "https://github.myCompany.com/api/v3/users/userName/subscriptions",
            "organizations_url": "https://github.myCompany.com/api/v3/users/userName/orgs",
            "repos_url": "https://github.myCompany.com/api/v3/users/userName/repos",
            "events_url": "https://github.myCompany.com/api/v3/users/userName/events{/privacy}",
            "received_events_url": "https://github.myCompany.com/api/v3/users/userName/received_events",
            "type": "User",
            "site_admin": false,
            "ldap_dn": "CN=userName,CN=Users,DC=rails,DC=rwy,DC=myCompany,DC=com"
        },
        "private": false,
        "html_url": "https://github.myCompany.com/userName/repoName",
        "description": "TEst",
        "fork": false,
        "url": "https://github.myCompany.com/api/v3/repos/userName/repoName",
        "forks_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/forks",
        "keys_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/keys{/key_id}",
        "collaborators_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/collaborators{/collaborator}",
        "teams_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/teams",
        "hooks_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/hooks",
        "issue_events_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/issues/events{/number}",
        "events_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/events",
        "assignees_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/assignees{/user}",
        "branches_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/branches{/branch}",
        "tags_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/tags",
        "blobs_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/git/blobs{/sha}",
        "git_tags_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/git/tags{/sha}",
        "git_refs_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/git/refs{/sha}",
        "trees_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/git/trees{/sha}",
        "statuses_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/statuses/{sha}",
        "languages_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/languages",
        "stargazers_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/stargazers",
        "contributors_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/contributors",
        "subscribers_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/subscribers",
        "subscription_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/subscription",
        "commits_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/commits{/sha}",
        "git_commits_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/git/commits{/sha}",
        "comments_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/comments{/number}",
        "issue_comment_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/issues/comments{/number}",
        "contents_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/contents/{+path}",
        "compare_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/compare/{base}...{head}",
        "merges_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/merges",
        "archive_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/{archive_format}{/ref}",
        "downloads_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/downloads",
        "issues_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/issues{/number}",
        "pulls_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/pulls{/number}",
        "milestones_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/milestones{/number}",
        "notifications_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/notifications{?since,all,participating}",
        "labels_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/labels{/name}",
        "releases_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/releases{/id}",
        "deployments_url": "https://github.myCompany.com/api/v3/repos/userName/repoName/deployments",
        "created_at": "2018-05-10T16:46:30Z",
        "updated_at": "2019-04-11T15:02:46Z",
        "pushed_at": "2018-10-10T16:47:17Z",
        "git_url": "git://github.myCompany.com/userName/repoName.git",
        "ssh_url": "git@github.myCompany.com:userName/repoName.git",
        "clone_url": "https://github.myCompany.com/userName/repoName.git",
        "svn_url": "https://github.myCompany.com/userName/repoName",
        "homepage": null,
        "size": 1214,
        "stargazers_count": 0,
        "watchers_count": 0,
        "language": "TEst",
        "has_issues": true,
        "has_projects": true,
        "has_downloads": true,
        "has_wiki": true,
        "has_pages": true,
        "forks_count": 0,
        "mirror_url": null,
        "archived": false,
        "open_issues_count": 0,
        "forks": 0,
        "open_issues": 0,
        "watchers": 0,
        "default_branch": "master"
    }
]

 

Custom Connector details: 

- Host: github.myCompany.com

- Base URL: /

- Security: Basic Authentication w/ "username" and "password" labels

- New Action: GET_REPO_INFO

- Request: GET, https://github.myCompany.com/api/v3/users/myUsername/repos

- Response:

HEADERS:
Server GitHub.com
Date Fri, 26 Jul 2019 20:26:37 GMT
Content-Type application/json; charset=utf-8
Content-Length 5422
Status 200 OK
Cache-Control public, max-age=60, s-maxage=60
Vary Accept
ETag "03d7efbf45f31e3de86d4786db0fe997"
X-GitHub-Enterprise-Version 2.12.3
X-GitHub-Media-Type github.v3; format=json
Access-Control-Expose-Headers ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin *
X-GitHub-Request-Id 9854b2df-e84e-4909-9bc8-2a2823ab4959
Content-Security-Policy default-src 'none'
Strict-Transport-Security max-age=31536000; includeSubdomains
X-Content-Type-Options nosniff
X-Frame-Options deny
X-XSS-Protection 1; mode=block
X-Runtime-rack 0.049464

BODY:
ABOVE RESPONSE FROM POSTMAN PASTED IN WITHOUT THE LEADING "[" AND TRAILING "]"

- Validation: Succeeded

- Click Create Connector

  - "Custom Connector has been successfully created"

- Click Test then New Connection

  - Enter Windows username and password

- Connection created, navigate back to Custom Connector

- Click Test: "Operation failed (500), see response below"

  - Request

Url
https://msmanaged-na.azure-apim.net/apim/enterprisegithub.<redacted>/<redacted>/api/v3/users/myUsername/repos
Method
get
Headers
{
"Authorization": "Bearer <redacted>"
}

  - Response:

Status
Internal Server Error (500)
Headers
{
  "cache-control": "proxy-revalidate",
  "content-length": "259",
  "content-type": "application/json"
}
Body
{
  "error": {
    "code": 500,
    "message": "The remote name could not be resolved: 'github.myCompany.com'",
    "source": "msmanaged-na.azure-apim.net",
    "path": "forward-request",
    "clientRequestId": "01aeb31f-4eef-44d0-80c8-9baf-03ccd57d"
  }
}

- Schema ValidationValidation Succeeded

 

Can you see what I'm doing wrong?

Super User
Super User

Re: ENTERPRISE GITHUB: Custom Connector?

Hi Kris,

I cannot get this to work. 
Tried:

  • Custom Connector with:
    • Basic, Windows, OAUTH2 and no security
    • Access token in header and URL
  • Just tried a dead simple Flow, just an HTTP request

Error: "The provided host name 'github.mycompany.com' could not be resolved"

image.png

image.png

 

Works in Postman without issue... maybe I'll try Exporting/Importing an OpenAPI definition next.

Highlighted
Super User
Super User

Re: ENTERPRISE GITHUB: Custom Connector?

@v-xida-msft ,

Hm. Exporting/Importing Postman collection did not work either...

Tried with "No Authentication" and with "Basic Authentication". 
Same result:

image.png

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 410 members 5,286 guests
Please welcome our newest community members: