Package com.logicaldoc.google
Class GoogleAuthHelper
java.lang.Object
com.logicaldoc.google.GoogleAuthHelper
A helper class for Google's OAuth2 authentication API.
- Since:
- 7.3
- Author:
- Marco Meschieri - LogicalDOC
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringCallback URI that google will redirect to after successful authentication
- 
Constructor SummaryConstructorsConstructorDescriptionGoogleAuthHelper(String name, String clientId, String clientSectet, jakarta.servlet.http.HttpServletRequest request) Constructor initializes the Google Authorization Code Flow with CLIENT ID, SECRET, and SCOPEGoogleAuthHelper(String name, String clientId, String clientSectet, String callbackUrl) 
- 
Method SummaryModifier and TypeMethodDescriptionBuilds a login URL based on client ID, secret, callback URI, and scopevoidonAuthorizationCallback(String authCode) 
- 
Field Details- 
CALLBACK_PATHCallback URI that google will redirect to after successful authentication- See Also:
 
 
- 
- 
Constructor Details- 
GoogleAuthHelperpublic GoogleAuthHelper(String name, String clientId, String clientSectet, String callbackUrl) throws IOException - Throws:
- IOException
 
- 
GoogleAuthHelperpublic GoogleAuthHelper(String name, String clientId, String clientSectet, jakarta.servlet.http.HttpServletRequest request) throws IOException Constructor initializes the Google Authorization Code Flow with CLIENT ID, SECRET, and SCOPE- Parameters:
- name- identifier of the Google configuration
- clientId- identifier of the client
- clientSectet- the key given by the user
- request- the HTTP request
- Throws:
- IOException- error in the communication with Google Drive
 
 
- 
- 
Method Details- 
buildLoginUrlBuilds a login URL based on client ID, secret, callback URI, and scope- Returns:
- the complete login URL
 
- 
onAuthorizationCallbackpublic void onAuthorizationCallback(String authCode) throws IOException, com.logicaldoc.core.PersistenceException, com.logicaldoc.util.security.StringEncrypter.EncryptionException - Throws:
- IOException
- com.logicaldoc.core.PersistenceException
- com.logicaldoc.util.security.StringEncrypter.EncryptionException
 
 
-