use of com.dropbox.core.DbxSessionStore in project dropbox-webhooks-spring-boot-example by zeldan.
the class DropboxService method finishAuthAndSaveUserDetails.
public void finishAuthAndSaveUserDetails(final HttpSession session, final Map<String, String[]> parameterMap) throws Exception {
final DbxSessionStore csrfTokenStore = new DbxStandardSessionStore(session, dropboxConfigProp.getSessionStore().getKey());
final DbxAuthFinish authFinish = auth.finishFromRedirect(dropboxConfigProp.getRedirectUri(), csrfTokenStore, parameterMap);
final String accessToken = authFinish.getAccessToken();
final DbxClientV2 client = new DbxClientV2(requestConfig, accessToken);
final String userId = authFinish.getUserId();
final ListFolderResult listFolderResult = client.files().listFolderBuilder("").withRecursive(true).start();
saveAccessTokenAndActualCursor(userId, accessToken, listFolderResult);
}
use of com.dropbox.core.DbxSessionStore in project dropbox-webhooks-spring-boot-example by zeldan.
the class DropboxService method startAuth.
public String startAuth(final HttpSession session) {
final DbxSessionStore csrfTokenStore = new DbxStandardSessionStore(session, dropboxConfigProp.getSessionStore().getKey());
final DbxWebAuth.Request authRequest = DbxWebAuth.newRequestBuilder().withRedirectUri(dropboxConfigProp.getRedirectUri(), csrfTokenStore).build();
return auth.authorize(authRequest);
}
Aggregations