oauth 2.0 updates #technight in osaka
TRANSCRIPT
OAuth 2.0 Updates
11年9月8日木曜日
OpenID TechNight #7
@nov
OpenID Foundation Japan Translation & Education WG
Translated OpenID 2.0, OAuth 1.0 & 2.0 specs
Web Developer @ iKnow!
OAuth.jp
Ruby Libraries
rack-oauth2, fb_graph, openid_connect etc.
11年9月8日木曜日
OpenID TechNight #7
OAuth in 5 min
11年9月8日木曜日
OpenID TechNight #7
Current Trend
Mobile Game Social
11年9月8日木曜日
OpenID TechNight #7
API Integration
Access Control for APIs
11年9月8日木曜日
OpenID TechNight #7
API Integration
Basic Auth
11年9月8日木曜日
OpenID TechNight #711年9月8日木曜日
OpenID TechNight #7
I’m using same passwordon 10+ services.
11年9月8日木曜日
OpenID TechNight #7
OAuth
No password sharing
Limited access lifetime
Expire a,er N weeks
Limited access scope
Status Update : OK
Read Inbox : NG
11年9月8日木曜日
OpenID TechNight #7
OAuth Everywhere
Mobile SocialGame
11年9月8日木曜日
OpenID TechNight #7
In B2B area too
11年9月8日木曜日
OpenID TechNight #711年9月8日木曜日
OpenID TechNight #7
OpenID Connect
11年9月8日木曜日
OpenID TechNight #7
Rough History
11年9月8日木曜日
OpenID TechNight #7
2007.12 OAuth 1.0
11年9月8日木曜日
OpenID TechNight #7
Twitter API11年9月8日木曜日
OpenID TechNight #7
2010.04 OAuth 2.0(dra, 0)
11年9月8日木曜日
OpenID TechNight #7
Facebook Graph API11年9月8日木曜日
OpenID TechNight #7
2010.07 dra, 10
11年9月8日木曜日
OpenID TechNight #7
mixi Graph API11年9月8日木曜日
OpenID TechNight #711年9月8日木曜日
OpenID TechNight #7
2011.07 dra, 20
11年9月8日木曜日
OpenID TechNight #7
Review by 8/1211年9月8日木曜日
OpenID TechNight #7
WG Feedback(mainly on Security Considerations)
11年9月8日木曜日
OpenID TechNight #7
2011.09 dra, 21
11年9月8日木曜日
OpenID TechNight #7
Latest Spechttp://j.mp/oauth2_21
11年9月8日木曜日
OpenID TechNight #7
ResourceOwner
Client
ResourceServer
APIAccess
AccessToken
AuthorizationServer
AuthorizeClient Access
11年9月8日木曜日
OpenID TechNight #7
ResourceOwner
Client
ResourceServer
APIAccess
AccessToken
AuthorizationServer
AuthorizeClient Access
11年9月8日木曜日
OpenID TechNight #7
ResourceOwner
Client
ResourceServer
APIAccess
AccessToken
AuthorizationServer
AuthorizeClient Access
11年9月8日木曜日
OpenID TechNight #7
ResourceOwner
Client
ResourceServer
APIAccess
AccessToken
AuthorizationServer
AuthorizeClient Access
Core Spec
Token Type Spec11年9月8日木曜日
OpenID TechNight #7
Core Spec
ResourceOwner
Client
ResourceServer
APIAccess
AccessToken
AuthorizationServer
AuthorizeClient Access
11年9月8日木曜日
OpenID TechNight #7
Response Type
Code
Secure
2 HTTP request
Require Approval
Get Access Token
Token
Efficient
1 HTTP request
Both at once
+ extensions
Core
11年9月8日木曜日
OpenID TechNight #7
response_type = codeResource Owner Client Authorization Server
Initiate
Require Approval
Approve
Code
Code
Access Token
Core
11年9月8日木曜日
OpenID TechNight #7
response_type = tokenResource Owner Client Authorization Server
Initiate
Require Approval
Approve
Access Token
Core
11年9月8日木曜日
OpenID TechNight #7
Client Type
Confidential
Has client secret
Eg.) Web app
Public
No client secret
Eg.) Mobile/JS app
Core
11年9月8日木曜日
OpenID TechNight #7
response_type = codeResource Owner Client Authorization Server
Initiate
Require Approval
Approve
Access Token
client_id=...&response_type=code&redirect_uri=https://...
Core
Code
Code
11年9月8日木曜日
OpenID TechNight #7
response_type = codeResource Owner Client Authorization Server
Initiate
Require Approval
Approve
Access Token
client_id=...&response_type=code&redirect_uri=https://...
Core
Code
Code
code=...&client_id=...&client_secret=...&redirect_uri=https://...
11年9月8日木曜日
OpenID TechNight #7
response_type = codeResource Owner Client Authorization Server
Initiate
Require Approval
Approve
Access Token
client_id=...&response_type=code&redirect_uri=https://...
Core
Code
Code
code=...&client_id=...&client_secret=...&redirect_uri=https://...
Public clients CANNOT do Client Authentication
“client_secret” is NOT REQUIRED for public clients
Rely on “redirect_uri” verification instead
Public clients MUST pre-register “redirect_uri”
11年9月8日木曜日
OpenID TechNight #7
response_type = tokenResource Owner Client Authorization Server
Initiate
Require Approval
Approve
client_id=...&response_type=token&redirect_uri=https://...
Core
Access Token
11年9月8日木曜日
OpenID TechNight #7
response_type = tokenResource Owner Client Authorization Server
Initiate
Require Approval
ApproveAll clients MUST pre-register “redirect_uri”
client_id=...&response_type=token&redirect_uri=https://...
Core
Access Token
11年9月8日木曜日
OpenID TechNight #7
Notes
For Servers
Do you support public clients? Do you need iPhone/Android apps support?
Require full redirect URI registration
Narrower scopes / shorter lifetime for public clients
For Clients
Don’t include client secret in your mobile app
Core
11年9月8日木曜日
OpenID TechNight #7
Security Considerations
Don’t issue “client_secret” to public clients
“redirect_uri” verification is important especially for public clients
Consider security policy per client type
Use “state” param against CSRF / code injection attack
etc.
Core
11年9月8日木曜日
OpenID TechNight #7
Attacker Client Authorization Server
Initiate
Require Approval
Approve
Code
Access Token
Code
CodeCode
11年9月8日木曜日
OpenID TechNight #7
Attacker Client Authorization Server
Initiate
Require Approval
Approve
Code
Access Token
Code
CodeCode
Allow attacker to loginwith attacker’s Twitter account
11年9月8日木曜日
OpenID TechNight #7
Attacker Client Authorization Server
Initiate
Require Approval
Approve
Code
Code
Code
State
State
State
Store “state”in Cookie etc.
State
“state”verification
failed!!
11年9月8日木曜日
OpenID TechNight #7
In dra, 21, “state” is RECOMMENDED
11年9月8日木曜日
OpenID TechNight #7
Token Type Spec
ResourceOwner
Client
ResourceServer
APIAccess
AccessToken
AuthorizationServer
AuthorizeClient Access
11年9月8日木曜日
OpenID TechNight #7
Token Type Spec
Bearer
No signature
No token secret
Mainstream
MAC
Signature
Token secret
Similar to OAuth 1.0
Token
+ extensions
11年9月8日木曜日
OpenID TechNight #7
Bearer Token
Access Token Response
Token
11年9月8日木曜日
OpenID TechNight #7
API Access (Bearer)Token
11年9月8日木曜日
OpenID TechNight #7
MAC Token
Access Token Response
Token
11年9月8日木曜日
OpenID TechNight #7
API Access (MAC)Token
11年9月8日木曜日
OpenID TechNight #7
Notes
For Servers
Access Token Response
Set “token_type” as “bearer”
Resource Request
Support both “OAuth” and “Bearer” auth header
Support both “oauth_token” and “access_token” query/body params
Token
11年9月8日木曜日
OpenID TechNight #7
Notes
For Clients
Move from “OAuth” to “Bearer”
Move from “oauth_token” to “access_token”
Only for Facebook API developers
Access token response will be JSON
Token
11年9月8日木曜日
OpenID TechNight #7
APPENDIX
11年9月8日木曜日
OpenID TechNight #7
FB OAuth Updates11年9月8日木曜日
OpenID TechNight #7
Using legacy FB APIs? (~2010.04)
No more “fb_sig” and “fb_sig_session_key”
Migrate to OAuth 2.0 (http://j.mp/fb_sig_to_oauth)
Your library might not work anymore
OAuth Migration(by 2011.09.30)
11年9月8日木曜日
OpenID TechNight #7
OAuth Migration(by 2011.09.30)
Developing canvas or page tab apps?
No more “fb_sig”
Migrate to “signed_request”
Obtain SSL certificate
11年9月8日木曜日
OpenID TechNight #7
Using FB.login (or <fb:login-button>) and FB cookie?
Now “code” is in the cookie, not “access_token”
Needs to exchange the code with access token
OAuth Migration(by 2011.09.30)
11年9月8日木曜日
OpenID TechNight #7
Using “response_type=code_and_token”?
Use “response_type=code%20token” instead
OAuth Spec Updates
11年9月8日木曜日