从访问密钥获取UserInfo

时间:2019-01-02 18:10:41

标签: rest access-token userinfo

我正在尝试使用API​​与Docusign集成

我使用集成密钥和客户端令牌成功生成了访问令牌。接下来,我正在使用新令牌获取UserInfo

apiClient.getTokenEndPoint().setCode(authCode);
apiClient.getTokenEndPoint().setGrantType(GrantType.CLIENT_CREDENTIALS);

apiClient.registerAccessTokenListener(new AccessTokenListener() {
    @Override
    public void notify(BasicOAuthToken token) {
        System.out.println("Got a fresh token: " + token.getAccessToken());
        try {
            userInfo = apiClient.getUserInfo(token.getAccessToken());
        } catch (IllegalArgumentException | ApiException e) {
            e.printStackTrace();
        }
    }
});

apiClient.updateAccessToken();

但是我在account-d.docusign.com服务器上收到以下内部服务器错误,参考ID 3ef37d61-4d5d-47ff-ab44-13d4e70bd8d1。

com.docusign.esign.client.ApiException: Error: Error while requesting server, received a non successful HTTP code 401 with response Body: '{"error":"internal_server_error","reference_id":"9a51533b-d2c3-4724-ae55-6a593dd67378"}'
at com.gp.service.docusign.DocuSignService.getUserInfo(DocuSignService.java:160)
at com.gp.service.docusign.DocuSignService$1.notify(DocuSignService.java:117)
at com.docusign.esign.client.auth.OAuth.updateAccessToken(OAuth.java:135)

使用服务器demo.docusign.net

com.docusign.esign.client.ApiException: Error: Error while requesting server, received a non successful HTTP code 404 with response Body: ''

0 个答案:

没有答案