Weitere ähnliche Inhalte Ähnlich wie Spring Day 2016 - Web API アクセス制御の最適解 (20) Mehr von 都元ダイスケ Miyamoto (20) Spring Day 2016 - Web API アクセス制御の最適解1. #springday
∼ Basic認証? APIキー? OAuth 2.0? OpenID Connect? ∼
Spring Security で作る
Web API アクセス制御の
最適解
クラスメソッド株式会社
都元ダイスケ
SPRING DAY 2016
グラントウキョウサウスタワー41F
ROOM3-5
2016/11/18 (Fri)
11. #springday
WHAT YOU ARE (inherence factor)
顔貌、声、指紋、署名など、その人自身の提示。
WHAT YOU HAVE (possession factor)
身分証、携帯電話等、その人だけが持っているものの提示。
WHAT YOU KNOW (knowledge factor)
パスワード、秘密の質問等、その人だけが知っていることの提示。
認証の方法 11
15. #springday
散々disられているが、決定的な否定理由が見つからない。
BASIC認証 over HTTPS は、OAuth 2.0(後述)及び
その周辺プロトコルにおける、1つの技術要素。
Access Token Request, Revocation, Introspection
API における BASIC認証 over HTTPS 15
Is HTTPS and Basic Authentication secure enough for banking webservices (RESTful)?
http://security.stackexchange.com/questions/44811/
21. #springday
message = リクエスト内容+現在時刻 等
secret = シークレット・アクセスキー
上記でHMACを計算、これを署名とする。
リクエストと共に、ヘッダで署名を送る。
署名は動的クレデンシャル。
HMACによるリクエスト署名 21
実は、OAuth 1.0a はこんな感じの仕組みでリクエストを行う。
つまり、リクエスト毎に面倒な計算が必要。
35. #springday
認証
Authentication userAuthentication;
エンドユーザが持つ権限(認可)
Collection<GrantedAuthority> userAuthorities
= userAuthentication.getGrantedAuthorities();
OAuth2における認証(直接的にはクライアントの認証)
OAuth2Authentication oauth2AuthN; // (has-a userAuthentication)
OAuth2においてエンドユーザから委譲を受けた権限の範囲
Set<String> scopes
= oauth2AuthN.getOAuth2Request().getScope();
Client Credentials 認証においてクライアントが持つ権限(認可)
Collection<GrantedAuthority> clientAuthorities
= oauth2AuthN.getOAuth2Request().getAuthorities();
Spring security のモデル 35
37. #springday
むしろ OAuth 2.0 よりもシンプル。
個人的に、とっっっっても面白い技術。
でも実は Web API の認証には
あんまり関係が深くない。
というわけで、今日の話のスコープ外。
OpenID Connect 37