Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a way to only generate access tokens from installation #48

Open
patricioperezv opened this issue Dec 24, 2020 · 1 comment
Open

Comments

@patricioperezv
Copy link

Hi, i'm playing with a use case in which i need to get an access token from a github application (appid and installation id), this access token is used to clone a repo, so i don't really need any more actions to be done on the github api (Besides getting the access token), i would really like to use this library for that purpose, is it possible?
I tried the following:

GitHubClient hubClient = GitHubClient.create(
    URI.create(GITHUB_ENDPOINT),
    new File(pemLocation),
    applicationId,
    installationId
);

SearchClient searchClient = hubClient.createSearchClient();
searchClient.users(ImmutableSearchParameters.builder().q("dumbdumb").build());

Optional<String> accessToken = hubClient.getAccessToken();

But the access token doesn't get populated

@Abhi347
Copy link
Member

Abhi347 commented Feb 5, 2021

Hey, I don't think the Access Token is generated without making any request, so calling getAccessToken() will fail. The access token is generated here in case this helps you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants