2016-08-30 3 views
0

http://docs.gitlab.com/ce/api/oauth2.html에 대한 문서를 읽지 만 OAuth 토큰을 취소하고 새로 고치는 방법에 대한 정보는 없습니다.GitLab 새로 고침 oAuth 토큰

토큰 응답 에서처럼 새로 고침 토큰을 얻는 것처럼 토큰 새로 고침이 필요할 수 있습니다.

{ 
    "access_token": "de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54", 
    "token_type": "bearer", 
    "scope": "api", 
    "created_at": 1372559331 
    "refresh_token": "8257e65c97202ed1726cf9571600918f3bffb2544b26e00a61df9897668c33a1" 
} 

답변

1

좋아, 나는 그것을 발견 주위 파고 후 : 당신이 경우에 자신을 잠글 수도로 토큰을 새로 고침 최근 GitLab 버전

Map<String, String> parameters = new HashMap<>(); 
parameters.put("grant_type", "refresh_token"); 
parameters.put("refresh_token", refreshToken); 
parameters.put("scope", "api"); 

return post("https://gitlab.com/oauth/token", parameters, ... 

참고이 필요하지 않습니다 요청이 실패를 (응답 당신에게 도달하지는 못했지만) 토큰이 변경되었습니다.