페이지

2014년 7월 3일 목요일

OAuth 2.0

OpenID는 한곳에서 ID/PW 관리/인증 OpenID authentication
OAuth = Authentication (인증) + Authorization (API 사용 권한부여)
OAuth 비번저장없이 사용가능 - 인증토큰
인증토큰
- 서비스에 패스워드 전달없이 인증
- 필요한 기능만 제한적으로 부여 할 수 있음
- 언제나 다시 권한 취소 가능
- 패스워드 변경시에도 유효

API를 사용하는 서비스(consumer)에 비밀번호를 저장하지 않고 인증토큰을 저장해 놓고 인증토큰(Access Token)으로 API 사용
Consumer key = API key
Oauth 의 버젼
1.0  보안 문제가 있는 버젼 - 사용하면안됨
1.0a 안정적, 사용가능, Http 상에서도 동작하도록 복잡한 암호화를 함

OAuth 1.0a 인증 프로세스 (원본 출처: http://earlybird.kr/1584)


OAuth 1.0a 전체 절차 (원본 출처: http://www.slideshare.net/okgosu/jco13-okgosu-20130218)


그림 1 OAuth 1.0a 인증 과정(원본 출처: http://oauth.net/core/diagram.png)



OAuth 2.0
- IEFT에 의해서 계속 표준화진행중
- Https
- bearer token 방식은 안정적이며 구현이 간단. SSL 필요
- 다른 2가지는 계속 수정 중 (MAC toke, SAML)
- 웹 애플리케이션이 아닌 애플리케이션 지원 강화
- 암호화가 필요 없음
- HTTPS를 사용하고 HMAC을 사용하지 않는다.
- Siganature 단순화
- 정렬과 URL 인코딩이 필요 없다.
- Access Token 갱신
- OAuth 1.0에서 Access Token을 받으면 Access Token을 계속 사용할 수 있었다. 트위터의 경우에는 Access Token을 만료시키지 않는다. OAuth 2.0에서는 보안 강화를 위해 Access Token의 Life-time을 지정할 수 있도록 했다.

Example of how OAuth 2.0 is used to share data via applications.​ (원본 출처 : http://tutorials.jenkov.com/oauth2/overview.html )
OAuth 2.0 authorization must be implemented in the order of the flow chart shown below.
적절하지 않는 사용
- 서버간 통신
- 유저개입없는 API
​- 상업적수준보안 (이체,계약등)
참조​
​OAuth와 춤을
기획자를 위한 OAuth - SlideShare​
OAuth 2.0 WIKI
http://en.wikipedia.org/wiki/OAuth
http://ko.wikipedia.org/wiki/OAuth
http://oauth.net/core/diagram.png
OAuth 2.0
http://oauth.net/2/
OAuth 2.0 – Open API 인증을 위한 만능 도구상자
http://earlybird.kr/1584
OAuth 2.0 인증 구현 (Google)
https://developers.google.com/youtube/v3/guides/authentication?hl=ko-kr
https://developers.google.com/accounts/docs/OAuth2?hl=ko
OAuth 2.0 시작하기 (Daum)
http://dna.daum.net/apis/oauth2/intro
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
http://www.slideshare.net/okgosu/jco13-okgosu-20130218
Online Game Development Guide/Online Game Integration Guide/OAuth 2.0 Authorization
http://gamedev.naver.com/index.php/Online_Game_Development_Guide/Online_Game_Integration_Guide/OAuth_2.0_Authorization
Designing a Secure REST (Web) API without OAuth
http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/
No basic authentication. The idea is simple and exactly as what you do above except no signing. This is how I implemented it
1. Client asks for a token by going to /REST/newToken?user=Amir&pass=PASSWORD
The above should return a token to the client and the application should save that token to associate with that user
2. To actually use the API, you do /REST/someservice?token=TOKEN
Here the TOKEN is from step 1.
You don’t need to sign anything because https is already taking care of that for you. All the app needs to do is look up the token to find the user.
Now you may ask, isn’t sending username and password in step 1 still exposing the password. I thought that too and if you look at HTTPS closer, you will notice that even the URL is secured and any man in middle can not see the URL.
So as you can see, the client is simpler because it doesn’t have to worry about signing anything. The server is simpler because it just relies on SSL doing the work for it. Everybody is happy. You don’t even need to worry about replay attack because someone would need to be able to look inside the HTTP request to be able to resend everything.
The only hint I have is that Android is really fussy about SSL. For example, last time I worked with it, it failed to validate the difference between http://www.foo.com and foo.com in the SSL certificate. But there are ways around that.
http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/comment-page-1/#comment-269282


네이버 개발자 센터 : http://developer.naver.com/wiki/pages/OAuth2
구글 개발자 사이트 : https://developers.google.com/accounts/docs/OAuth2
SKPlanet 개발자 센터: https://developers.skplanetx.com/apidoc/kor/authentication/
OAuth2 - API 인증을 위한 만능도구상자 http://www.slideshare.net/tebica/oauth2-api
페이스북 개발자 사이트: https://developers.facebook.com/docs/facebook-login/overview
트위터 개발자 센터: https://dev.twitter.com/docs/auth/application-only-auth
Github 개발자 센터: https://github.com/reddit/reddit/wiki/OAuth2
인스타그램 개발자 센터: http://instagram.com/developer/authentication/
포스퀘어 개발자 센터: https://developer.foursquare.com/overview/auth
OAuth 2.0 공식 사이트 : http://oauth.net/2/
Daum OAuth 2.0 안내 페이지 : http://dna.daum.net/apis/oauth2

댓글 없음 :

댓글 쓰기