양쪽 이전 판이전 판다음 판 | 이전 판 |
research:oauth20 [2014/02/24 00:15] – [OAuth 2.0 알아보기] changwoo | research:oauth20 [2014/10/09 21:24] (현재) – 바깥 편집 127.0.0.1 |
---|
==== (F) Protected Resource (Resource Server --> Client) ==== | ==== (F) Protected Resource (Resource Server --> Client) ==== |
access token을 통해 resource server로부터 데이터를 받아 옵니다. 이 데이터는 client에서 적절히 목적에 맞게 사용됩니다. | access token을 통해 resource server로부터 데이터를 받아 옵니다. 이 데이터는 client에서 적절히 목적에 맞게 사용됩니다. |
| |
| |
| |
| |
| |
| |
| |
| |
| ===== Google OAuth 2.0 for Installed Applications 과 연결 ===== |
| ==== Authentication URL 얻기 ==== |
| Authentication url 요청을 얻는 url은 ''https://accounts.google.com/o/oauth2/auth''이다. 여기에 파라미터들을 적어 보내야 하는데, [[https://developers.google.com/accounts/docs/OAuth2InstalledApp#formingtheurl | Forming the URL]] 부분을 참고하면 된다. 이 주소로 직접 사용자가 로그인을 해야 한다. GUI 방식이면 따로 웹브라우저를 띄우든지, 완전 CLI 라면 해당 URL로 접속하라는 통지를 주어야 한다. |
| |
| ==== Authentication Code ==== |
| 보낸 정보를 바탕으로 인증 서버에서 authentication code를 발급해준다. Google의 ''urn:ietf:wg:oauth:2.0:oob&''의 경우라면 html tag의 title에도 이 코드가 담겨 있으니 html 코드를 분석해도 결과를 얻을 수 있다. 그러면 이 코드를 이용하여 access token을 요청할 수 있다. 토큰을 요청하는 곳의 주소는 ''https://accounts.google.com/o/oauth2/token''. 그리고 여기에 보내는 파라미터는 [[https://developers.google.com/accounts/docs/OAuth2InstalledApp#handlingtheresponse | Handling the response]]를 참고하라. |
| |
| ==== Access Token ==== |
| IMAP 서버에 접근하기 위해서는 access token을 IMAP 서버와 연동해야 한다. |
| |
| ==== Refreshing ==== |
| 토큰이 만료된 경우 재발급을 받아야 한다. ''https://accounts.google.com/o/oauth2/token''으로 요청/응답을 받으면 된다. 이 때 보내야 하는 데이터는 [[https://developers.google.com/accounts/docs/OAuth2InstalledApp#refresh | Using a refresh token]]을 참고하라. |
| |
===== 참고 페이지 ===== | ===== 참고 페이지 ===== |
* [[http://tools.ietf.org/html/draft-ietf-oauth-v2-22|The OAuth 2.0 Authorization Protocol draft-ietf-oauth-v2-22]] | * [[http://tools.ietf.org/html/draft-ietf-oauth-v2-22|The OAuth 2.0 Authorization Protocol draft-ietf-oauth-v2-22]] |
* [[http://earlybird.kr/1584|OAuth 2.0 – Open API 인증을 위한 만능 도구상자]]: 이 페이지는 한국어로 OAuth2.0을 잘 정리했습니다. 만약을 대비해 전문을 PDF로 만들어 첨부하였습니다. {{:research:oauth20:oauth2.0.pdf|}} | * [[http://earlybird.kr/1584|OAuth 2.0 – Open API 인증을 위한 만능 도구상자]]: 이 페이지는 한국어로 OAuth2.0을 잘 정리했습니다. 만약을 대비해 전문을 PDF로 만들어 첨부하였습니다. {{:research:oauth20:oauth2.0.pdf|}} |
* http://code.google.com/p/google-mail-oauth2-tools/wiki/OAuth2DotPyRunThrough | * http://code.google.com/p/google-mail-oauth2-tools/wiki/OAuth2DotPyRunThrough |
| * [[https://developers.google.com/accounts/docs/OAuth2InstalledApp | Google OAuth2 Installed App]] |
| |
| |