0
要找到連接,請我們在響應或一些連接ID,認證令牌如何獲得來自拉力賽的Java其餘API的連接ID /的authToken
要找到連接,請我們在響應或一些連接ID,認證令牌如何獲得來自拉力賽的Java其餘API的連接ID /的authToken
在最新Java REST API for Rally,則RallyRestApi類爭奪餅乾一個Rally SecurityToken通過受保護的attachSecurityInfo()方法。您也可以在以下鏈接的源代碼上述起始於線377看到attachSecurityInfo如何請求令牌,但它的癥結在這裏概述:
protected static final String SECURITY_TOKEN_PARAM_KEY = "key";
private static final String SECURITY_TOKEN_URL = "/security/authorize";
protected static final String SECURITY_TOKEN_KEY = "SecurityToken";
GetResponse getResponse = getWithForceReauth(new GetRequest(SECURITY_TOKEN_URL));
JsonObject operationResult = getResponse.getObject();
JsonPrimitive securityTokenPrimitive = operationResult.getAsJsonPrimitive(SECURITY_TOKEN_KEY);
securityToken = securityTokenPrimitive.getAsString();
public GetResponse getWithForceReauth(GetRequest request) throws IOException {
return get(request, true);
}
需要注意的是這隻能用於Java REST包1.07版或更高,並且需要(並且需要)Rally Webservices API 1.42或更高版本。