Skip to content

spring social, integration with storage providers, google drive

Ondřej Košarko edited this page Oct 4, 2017 · 2 revisions

Usage

This page describes the integration of google drive into submission upload step

Google Drive

https://console.developers.google.com

new project, add drive & google+ apis on dashboard, create credentials. The redirect uri is .../xmlui/connect/google

Get clientId and clientSecret

social.cfg

Configuration of oauth scopes, ids and secrets

enabled = ${social.enabled}
google.clientId = ${social.google.clientId}
google.clientSecret = ${social.google.clientSecret}
google.scope = email https://www.googleapis.com/auth/drive.readonly
userconnection.encrypt.password = ${social.userconnection.encrypt.password}
userconnection.encrypt.salt = ${social.userconnection.encrypt.salt}
  • the integration is disabled by default (nothing shows in submission)
  • google.clientId and google.clientSecret obtained in the previous step
  • google.scope (https://developers.google.com/identity/protocols/googlescopes)
  • the oauth access/refresh tokens are not stored in plain text, password and salt are used to encrypt them; salt is a hex string. You can generate the salt with hexdump -n 4 -e '2 "%08X" 1 "\n"' /dev/urandom

Internals [draft]

SocialConfig.java

connectionFactories (clientId, clientSecret) for various providers (currently drive), provider bean

other beans:

Encryptors

SocialMVCComponents

DriveController

AsyncBitstreamAdder

-responseExtractor

UploadStep

social.js

jitpack.io

spring version

Clone this wiki locally