Package com.logicaldoc.gdrive
Class GoogleAuthHelper
java.lang.Object
com.logicaldoc.gdrive.GoogleAuthHelper
A helper class for Google's OAuth2 authentication API.
- Since:
- 7.3
- Author:
- Marco Meschieri - LogicalDOC
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCallback URI that google will redirect to after successful authentication -
Constructor Summary
ConstructorsConstructorDescriptionGoogleAuthHelper(long userId, String clientId, String clientSectet, String callbackUrl) GoogleAuthHelper(long userId, String clientId, String clientSectet, javax.servlet.http.HttpServletRequest request) Constructor initializes the Google Authorization Code Flow with CLIENT ID, SECRET, and SCOPE -
Method Summary
Modifier and TypeMethodDescriptionBuilds a login URL based on client ID, secret, callback URI, and scopevoidonAuthorizationCallback(String authCode)
-
Field Details
-
CALLBACK_PATH
Callback URI that google will redirect to after successful authentication- See Also:
-
callBackUrl
-
-
Constructor Details
-
GoogleAuthHelper
public GoogleAuthHelper(long userId, String clientId, String clientSectet, String callbackUrl) throws IOException - Throws:
IOException
-
GoogleAuthHelper
public GoogleAuthHelper(long userId, String clientId, String clientSectet, javax.servlet.http.HttpServletRequest request) throws IOException Constructor initializes the Google Authorization Code Flow with CLIENT ID, SECRET, and SCOPE- Parameters:
userId- identifier of the userclientId- identifier of the clientclientSectet- the key given by the userrequest- the HTTP request- Throws:
IOException- error in the communication with Google Drive
-
-
Method Details
-
buildLoginUrl
Builds a login URL based on client ID, secret, callback URI, and scope- Returns:
- the complete login URL
-
onAuthorizationCallback
public void onAuthorizationCallback(String authCode) throws IOException, com.logicaldoc.core.PersistenceException, com.logicaldoc.gui.common.client.ServerException, com.logicaldoc.util.security.StringEncrypter.EncryptionException - Throws:
IOExceptioncom.logicaldoc.core.PersistenceExceptioncom.logicaldoc.gui.common.client.ServerExceptioncom.logicaldoc.util.security.StringEncrypter.EncryptionException
-