use of com.dropbox.core.DbxStandardSessionStore 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.DbxStandardSessionStore 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);
}
use of com.dropbox.core.DbxStandardSessionStore in project dropbox-sdk-java by dropbox.
the class DropboxAuth method getSessionStore.
// -------------------------------------------------------------------------------------------
private DbxSessionStore getSessionStore(final HttpServletRequest request) {
// Select a spot in the session for DbxWebAuth to store the CSRF token.
HttpSession session = request.getSession(true);
String sessionKey = "dropbox-auth-csrf-token";
return new DbxStandardSessionStore(session, sessionKey);
}
Aggregations