새로 고치기 토큰

OAuth 인증을 사용하는 경우 새로 고치기 토큰을 사용으로 설정할 수 있습니다. 현재 액세스 토큰이 올바르지 않게 되거나 만기될 때 새 액세스 토큰을 얻거나 동일하거나 더 좁은 범위의 추가 액세스 토큰을 얻기 위해 클라이언트에 새로 고치기 토큰이 발행됩니다.

OAuth 인증을 사용하는 경우 API 요청은 Authorization HTTP 헤더를 사용하여 올바른 액세스 토큰을 포함해야 합니다. IBM® API Connect 토큰 엔드포인트에서 발행되는 액세스 토큰은 기본적으로 3600초 (1시간) 동안 유효하며 토큰 요청에서 리턴되는 expires_in 특성으로 표시됩니다. 다음 코드 블록은 Authorization 헤더를 포함하는 API 요청 예제를 표시합니다.


GET /bankingApi/accountSummary?client_id=32427ce5-bb7c-48a7-9de3-4bb629091103
HTTP/1.1
Accept: application/json
Host: api.ibm.com
Authorization: Bearer AAEFYy1hbGxlhdS5nVX4x6iTL2sb3ymBivQb... 

액세스 토큰의 유효 기간이 만료된 후, OAuth 제공자 설정의 [토큰 > 리프레시 토큰 ] 화면에서 해당 옵션이 활성화되어 있는 경우, 애플리케이션은 리프레시 토큰을 사용합니다. 각 새로 고치기 토큰은 발행된 후 약 31일 동안(또는 지정된 수명(TTL)까지의 시간 동안) 유효하며 새 액세스 토큰을 요청하는 데 한 번만 사용될 수 있습니다. 새 액세스 토큰과 함께 새 새로 고치기 토큰도 리턴됩니다. 리프레시 토큰을 활성화하는 방법에 대한 자세한 내용은 ‘네이티브 OAuth 제공자 구성’을 참조하세요.

액세스 토큰이 만료되고 애플리케이션에 새로 고치기 토큰이 없는 경우 OAuth 제공자에서 허용되는 권한 부여 유형의 선택사항을 사용하여 OAuth 교환을 다시 시작해야 합니다.

Draft comment: bschramm
All the following info has been draft- commented until we can confirm its accuracy.For more information, see Creating an OAuth security definition.

Draft comment: bschramm
To request an access token, call the provider API's token endpoint operation with a POST call, including the following parameters:
  • client_id in the header or query as is specified for the provider API or as a user name if using a confidential scheme.
  • client_secret as a password if using a confidential scheme.
  • grant_type=refresh_token in the header.
  • refresh_token=Refresh_Token in the header, where Refresh_Token is your currently valid refresh token.

The response includes a new access token and a new refresh token.