Class OAuthClient
- java.lang.Object
-
- com.databricks.sdk.core.oauth.OAuthClient
-
public class OAuthClient extends Object
Enables 3-legged OAuth2 flow with PKCEFor a regular web app running on a server, it's recommended to use the Authorization Code Flow to obtain an Access Token and a Refresh Token. This method is considered safe because the Access Token is transmitted directly to the server hosting the app, without passing through the user's web browser and risking exposure.
To enhance the security of the Authorization Code Flow, the PKCE (Proof Key for Code Exchange) mechanism can be employed. With PKCE, the calling application generates a secret called the Code Verifier, which is verified by the authorization server. The app also creates a transform value of the Code Verifier, called the Code Challenge, and sends it over HTTPS to obtain an Authorization Code. By intercepting the Authorization Code, a malicious attacker cannot exchange it for a token without possessing the Code Verifier.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OAuthClient.Builder
-
Constructor Summary
Constructors Constructor Description OAuthClient(DatabricksConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAuthUrl()
String
getClientId()
String
getClientSecret()
String
getHost()
String
getRedirectUrl()
List<String>
getScopes()
String
getTokenUrl()
Consent
initiateConsent()
boolean
isAws()
boolean
isAzure()
-
-
-
Constructor Detail
-
OAuthClient
public OAuthClient(DatabricksConfig config) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getHost
public String getHost()
-
getClientId
public String getClientId()
-
getClientSecret
public String getClientSecret()
-
getRedirectUrl
public String getRedirectUrl()
-
getTokenUrl
public String getTokenUrl()
-
getAuthUrl
public String getAuthUrl()
-
isAws
public boolean isAws()
-
isAzure
public boolean isAzure()
-
initiateConsent
public Consent initiateConsent() throws MalformedURLException
- Throws:
MalformedURLException
-
-