-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1825471: Port and remove snowflake-common auth related codebase
- Loading branch information
1 parent
a20f2cf
commit b4322f3
Showing
11 changed files
with
160 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/net/snowflake/client/core/auth/AuthenticatorType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All right reserved. | ||
*/ | ||
package net.snowflake.client.core.auth; | ||
|
||
import net.snowflake.client.core.SnowflakeJdbcInternalApi; | ||
|
||
@SnowflakeJdbcInternalApi | ||
public enum AuthenticatorType { | ||
/* | ||
* regular login username+password via Snowflake, may or may not have MFA | ||
*/ | ||
SNOWFLAKE, | ||
|
||
/* | ||
* federated authentication, OKTA as IDP | ||
*/ | ||
OKTA, | ||
|
||
/* | ||
* Web browser based authenticator for SAML 2.0 compliant | ||
* service/application | ||
*/ | ||
EXTERNALBROWSER, | ||
|
||
/* | ||
* OAUTH 2.0 flow | ||
*/ | ||
OAUTH, | ||
|
||
/* | ||
* Snowflake local authentication using jwt token as a user credential | ||
*/ | ||
SNOWFLAKE_JWT, | ||
|
||
/* | ||
* Internal authenticator to enable id_token for web browser based authenticator | ||
*/ | ||
ID_TOKEN, | ||
|
||
/* | ||
* Authenticator to enable token for regular login with mfa | ||
*/ | ||
USERNAME_PASSWORD_MFA | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/net/snowflake/client/core/auth/ClientAuthnDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All right reserved. | ||
*/ | ||
package net.snowflake.client.core.auth; | ||
|
||
import java.util.Map; | ||
import javax.annotation.Nullable; | ||
import net.snowflake.client.core.SnowflakeJdbcInternalApi; | ||
|
||
@SnowflakeJdbcInternalApi | ||
public class ClientAuthnDTO { | ||
|
||
// contains all the required data for current authn step | ||
public final Map<String, Object> data; | ||
|
||
/* | ||
* current state | ||
* tokenized string with all current parameters and the authn step | ||
*/ | ||
private final String inFlightCtx; | ||
|
||
/** Required by Jackson */ | ||
public ClientAuthnDTO(Map<String, Object> data, @Nullable String inFlightCtx) { | ||
this.data = data; | ||
this.inFlightCtx = inFlightCtx; | ||
} | ||
|
||
public String getInFlightCtx() { | ||
return inFlightCtx; | ||
} | ||
} |
Oops, something went wrong.