Package com.isode.dsapi.util.oauth
Class OAuthClient
java.lang.Object
com.isode.dsapi.util.oauth.OAuthClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAbort()protected StringbuildAuthorizeRequest(SASLParameters saslParameters, String randomState, String pkceChallenge) protected com.isode.dsapi.util.oauth.OAuthClient.CodeAndVerifiercallBrowserToLogin(SASLParameters saslParameters) protected OAuthTokenfetchToken(SASLParameters saslParams, com.isode.dsapi.util.oauth.OAuthClient.CodeAndVerifier codeAndVerifier) protected StringgeneratePKCEChallenge(String codeVerifier) protected StringbooleangetOAuthToken(SASLParameters saslParams) booleanneedLoginForm(SASLParameters saslParams) protected OAuthTokenrefreshToken(SASLParameters saslParams) protected booleanverifyToken(SASLParameters saslParams, String accessToken) protected com.isode.dsapi.util.oauth.CodeAndStatewaitForCallback(SASLParameters saslParameters)
-
Constructor Details
-
OAuthClient
public OAuthClient()
-
-
Method Details
-
needLoginForm
- Throws:
IOExceptionInterruptedException
-
getOAuthToken
public boolean getOAuthToken(SASLParameters saslParams) throws IOException, InterruptedException, NoSuchAlgorithmException, ParseException, OAuthException, URISyntaxException -
Abort
public void Abort() -
verifyToken
protected boolean verifyToken(SASLParameters saslParams, String accessToken) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
refreshToken
protected OAuthToken refreshToken(SASLParameters saslParams) throws UnsupportedEncodingException, IOException, InterruptedException, OAuthException, ParseException -
fetchToken
protected OAuthToken fetchToken(SASLParameters saslParams, com.isode.dsapi.util.oauth.OAuthClient.CodeAndVerifier codeAndVerifier) throws IOException, ParseException, InterruptedException, OAuthException -
generateRandomString
-
generatePKCEChallenge
- Throws:
NoSuchAlgorithmException
-
buildAuthorizeRequest
protected String buildAuthorizeRequest(SASLParameters saslParameters, String randomState, String pkceChallenge) throws UnsupportedEncodingException, OAuthException -
callBrowserToLogin
protected com.isode.dsapi.util.oauth.OAuthClient.CodeAndVerifier callBrowserToLogin(SASLParameters saslParameters) throws IOException, NoSuchAlgorithmException, URISyntaxException, OAuthException, InterruptedException -
waitForCallback
protected com.isode.dsapi.util.oauth.CodeAndState waitForCallback(SASLParameters saslParameters) throws IOException, OAuthException, InterruptedException
-