Skip to content

App Authentication in Github Enterprise Server does not work #426

Closed
@lehmanju

Description

@lehmanju

Using App token authentication with Github Enterprise Server does not work because the base url defaults to github.com even though the custom URL is set.

This is caused by the following code:

itr, err := ghinstallation.New(http.DefaultTransport, appId, installationId, []byte(settings.PrivateKey))
if err != nil {
return nil, backend.DownstreamError(errors.New("error creating token source"))
}
httpClient := &http.Client{Transport: itr}
if settings.GitHubURL == "" {
return &Client{
restClient: googlegithub.NewClient(httpClient),
graphqlClient: githubv4.NewClient(httpClient),
}, nil
}
return useGitHubEnterprise(httpClient, settings)

The BaseURL of itr is not updated and defaults to github.com. To do this properly, do it as described here: bradleyfalzon/ghinstallation#90 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions