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 5 years have passed since last update.

ChronografのOAuth認証

Posted at

がいよう

Chronografをそのまま起動するとガバガバなので認証機能を付けます
この通りやるだけでしたがめも
なんかいろいろ選べるけどgoogleよりgithubのほうがお手軽でした

GitHubで認証する

githubにログインし右上から
Settings -> Developer settings -> New OAuth App

設定

  • Application name:任意 ex. chronograf
  • Homepage URL: http(s)://example.com
  • Authorization callback URL: http(s)://example.com/oauth/github/callback

これでレジスターするとclient IDとclient secretがもらえるので設定していく

chrnografの設定

環境変数にイカを登録するだけ

  • GH_CLIENT_ID=b339dd4fddd95abec9aa
  • GH_CLIENT_SECRET=260041897d3252c146ece6b46ba39bc1e54416dc
  • TOKEN_SECRET=Super5uperUdn3verGu355!

このclient ID, client secretはダミー。さっきもらったやつを登録する
TOKEN_SECRETは任意の文字列

chrnografを再起動すると
キャプチャ3.PNG
こうなって完了!

OAuthを登録したgithubアカウントでログインするとSuperAdminになってる
別のアカウントでログインするとユーザーが追加されるのでSuperAdminのアカウントから設定で権限を変えてやると閲覧できるようになる(ログインしたてはmember権限でなにもできない)

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?