본문 바로가기
쉽게 잘 설명한 페이지 소개

Authorization Code

by kakao-TAM 2021. 2. 14.

developer.okta.com/blog/2018/04/10/oauth-authorization-code-grant-type

 

What is the OAuth 2.0 Authorization Code Grant Type?

The Authorization Code Grant Type is used by both web apps and native apps to get an access token after a user authorizes an app. This post is the first part of a series where we explore the frequently used OAuth 2.0 grant types.

developer.okta.com

oauth.net/2/

 

OAuth 2.0 — OAuth

OAuth 2.0 OAuth 2.0 is the industry-standard protocol for authorization. OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices. This

oauth.net

카카오 로그인은 OAuth 2.0 표준을 따릅니다. 

OAuth 2.0은 인증을 위한 업계 표준 프로토콜로 클라이언트 개발자의 단순성에 초점을 맞추면서 다양한 장치에 대한 특정 인증 흐름을 제공합니다. 이 사양은 2012년 10월 IETF OAuth 워킹 그룹 내에서 개발되었습니다.

 

Redirect URI에 Code파라메터가 Get방식으로 주소 노출되는 것은 아래 이유로 크게 문제 없어 보입니다.

 

1. Code는 재사용이 불가능합니다.

2. Code를 이용하여 액세스 토큰 요청 시, Code 를 받은 URI와 동일한 Redirect URI를 파라메터로 넘겨야 토큰 발급이 가능합니다.

3. Redirect URI는 인증 서버 제공 업체에서 설정 해야하므로 임의 수정이 불가능합니다.

 

추가로 

Code 요청 시, state파라메터를 이용하여 CSRF 공격 을 방지를 할 수 있습니다. (Code 요청 시 생성한 난수를 서버에 임시 저장하였다가 Redirect URI를 호출 받았을때 검증해는 형태입니다.)

 

댓글