@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AccessToken {\n"); sb.append(" access_token: ").append(toIndentedString(access_token)).append("\n"); sb.append(" token_type: ").append(toIndentedString(token_type)).append("\n"); sb.append(" expires_in: ").append(toIndentedString(expires_in)).append("\n"); sb.append(" user_id: ").append(toIndentedString(expires_in)).append("\n"); sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); sb.append("}"); return sb.toString(); }
/** * Returns access token. * * @throws ApiException if the Api call fails */ @Test public void authorizeTest() throws ApiException { DefaultApi api = new DefaultApi(new ApiClient(), clientId, clientSecret); String code = ""; AccessToken response = api.authorize(code, redirectUri); assertNotNull(response); assertNotNull(response.getAccess_token()); assertEquals("bearer", response.getToken_type()); }
private ApiClient createApiClient() { ApiClient apiClient = new ApiClient(); apiClient.setBasePath(finapiConnectionUrl); apiClient.setAccessToken(clientToken != null ? clientToken.getAccessToken() : null); return apiClient; }
private String authorizeUser(BankApiUser bankApiUser) { try { return new AuthorizationApi(createApiClient()).getToken("password", finapiClientId, finapiSecret, null, bankApiUser.getApiUserId(), bankApiUser.getApiPassword()).getAccessToken(); } catch (ApiException e) { throw new RuntimeException(e); } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AccessToken {\n"); sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); sb.append("}"); return sb.toString(); }