Package com.isode.dsapi.util.oauth
Class OAuthClient
java.lang.Object
com.isode.dsapi.util.oauth.OAuthClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Abort()
protected String
buildAuthorizeRequest
(SASLParameters saslParameters, String randomState, String pkceChallenge) protected com.isode.dsapi.util.oauth.OAuthClient.CodeAndVerifier
callBrowserToLogin
(SASLParameters saslParameters) protected OAuthToken
fetchToken
(SASLParameters saslParams, com.isode.dsapi.util.oauth.OAuthClient.CodeAndVerifier codeAndVerifier) protected String
generatePKCEChallenge
(String codeVerifier) protected String
boolean
getOAuthToken
(SASLParameters saslParams) boolean
needLoginForm
(SASLParameters saslParams) protected OAuthToken
refreshToken
(SASLParameters saslParams) protected boolean
verifyToken
(SASLParameters saslParams, String accessToken) protected com.isode.dsapi.util.oauth.CodeAndState
waitForCallback
(SASLParameters saslParameters)
-
Constructor Details
-
OAuthClient
public OAuthClient()
-
-
Method Details
-
needLoginForm
- Throws:
IOException
InterruptedException
-
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:
IOException
InterruptedException
-
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
-