Authenticating as an installationIn order to authenticate to GitHub as an installation of your GitHub App, you must use the App Installation Tokenauthentication mechanism. This can be achieved with by creating a <<<GitHub>>> instance like this:+-----+GitHub githubAuthAsInst = new GitHubBuilder().withAppInstallationToken(appInstallationToken.getToken()).build();+-----+How do I create an App Installation Token?Assuming that you followed the {{{/githubappjwtauth.html} GitHub App Authentication via JWT token guide}} then youcan create the App Installation Token like this:+-----+String jwtToken = createJWT("44435", 600000); //sdk-github-api-app-testGitHub gitHubApp = new GitHubBuilder().withJwtToken(jwtToken).build();GHAppInstallation appInstallation = gitHubApp.getApp().getInstallationById(111111); // Installation IdMap<String, GHPermissionType> permissions = new HashMap<>();permissions.put("pull_requests", GHPermissionType.WRITE);GHAppInstallationToken appInstallationToken = appInstallation.createToken(permissions).create();// OrGHAppInstallationToken appInstallationToken = appInstallation.createToken().create();+-----+
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。