Package com.logicaldoc.gdrive
Class GoogleAuthHelper
- java.lang.Object
-
- com.logicaldoc.gdrive.GoogleAuthHelper
-
public final class GoogleAuthHelper extends Object
A helper class for Google's OAuth2 authentication API.- Since:
- 7.3
- Author:
- Marco Meschieri - LogicalDOC
-
-
Field Summary
Fields Modifier and Type Field Description static String
CALLBACK_PATH
Callback URI that google will redirect to after successful authenticationString
callBackUrl
-
Constructor Summary
Constructors Constructor Description GoogleAuthHelper(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
buildLoginUrl()
Builds a login URL based on client ID, secret, callback URI, and scopevoid
onAuthorizationCallback(String authCode)
-
-
-
Field Detail
-
CALLBACK_PATH
public static final String CALLBACK_PATH
Callback URI that google will redirect to after successful authentication- See Also:
- Constant Field Values
-
callBackUrl
public String callBackUrl
-
-
Constructor Detail
-
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
-
-