Skip to content

Instantly share code, notes, and snippets.

@yamabicodev
Last active December 6, 2021 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yamabicodev/a1b31c02225ffc2e935366c11ba62914 to your computer and use it in GitHub Desktop.
Save yamabicodev/a1b31c02225ffc2e935366c11ba62914 to your computer and use it in GitHub Desktop.
Spring Security Demo 2021
spring:
security:
oauth2:
client:
# 認証プロバイダ側でアプリケーション登録した際に発行されるClientID・Secret情報や、
# 認証タイプ・アクセススコープタイプ・プロバイダからのコールバック先等を指定する。
registration:
google: #「registration Id」と呼ばれる項目。認証設定を一意に表す値(基本は認証プロバイダ名が当てられる。)
client-id: {your-google-client-id}
client-secret: {your-google-client-secret}
# 認証プロバイダ側でログイン後 認証プロバイダ→クライアントへのコールバック先のURL
# 特に戻り先に条件がなければ設定をしなくても良い。
# 指定無しの場合は「/login/oauth2/code/{registrationId}」のパスにリダイレクト処理を行う。
redirect-uri: http://localhost:8080/login/oauth2/code/github
scope:
- openid
- email
- profile
github:
client-id: {your-github-client-id}
client-secret: {your-github-client-secret}
redirect-uri: http://localhost:8080/login/oauth2/code/github
scope:
- read:user
# Google Githubは以下のproviderセクションを省略してもOK
provider:
google:
authorization-uri: https://accounts.google.com/o/oauth2/v2/auth
token-uri: https://www.googleapis.com/oauth2/v4/token
jwk-set-uri: https://www.googleapis.com/oauth2/v3/certs
issuer-uri: https://accounts.google.com
user-info-uri: https://www.googleapis.com/oauth2/v3/userinfo
github:
authorization-uri: https://github.com/login/oauth/authorize
ttoken-uri: https://github.com/login/oauth/access_token
user-info-uri: https://api.github.com/user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment