1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

KeyCloakに連携したGitHub認証で得たGitHubのアクセストークンをアプリ側で取得する方法

Last updated at Posted at 2022-11-02

この投稿では、KeyCloak+GitHub認証で、GitHubのアクセストークンをKeyCloakに保存し、取得できるようにする設定のやりかたを説明します。

まず、「Identity Providers」のGitHubの設定画面を開き、「Store Tokens」と「Stored Tokens Readable」の2つの設定を「ON」にします。

CleanShot 2022-11-02 at 15.43.58.png

これにより、ユーザーのKeyCloakのアクセストークンを使うことで、GitHubのアクセストークンを取得できるようになります。GitHubのアクセストークンを取得するKeyCloak APIのエンドポイントは下記になります。

GET /realms/myrealm/broker/github/token HTTP/1.1
Host: localhost:8080
Authorization: Bearer <KEYCLOAK ACCESS TOKEN>

関連

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?