Skip to content

Commit

Permalink
SNOW-1692674 Remove *.okta.com check from native Okta authenticator v…
Browse files Browse the repository at this point in the history
…alidation (snowflakedb#1216)
  • Loading branch information
sfc-gh-dheyman-1 authored Oct 8, 2024
1 parent 1197e55 commit a95dd38
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func determineAuthenticatorType(cfg *Config, value string) error {
}
}

if oktaURL.Scheme != "https" || !strings.HasSuffix(oktaURL.Host, "okta.com") {
if oktaURL.Scheme != "https" {
return &SnowflakeError{
Number: ErrCodeFailedToParseAuthenticator,
Message: errMsgFailedToParseAuthenticator,
Expand Down
22 changes: 22 additions & 0 deletions dsn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,28 @@ func TestParseDSN(t *testing.T) {
ocspMode: ocspModeFailOpen,
err: nil,
},
{
dsn: fmt.Sprintf("u:[email protected]:9876?account=ac&protocol=http&authenticator=%v", url.QueryEscape("https://ac.some-host.com/custom-okta-url")),
config: &Config{
Account: "ac", User: "u", Password: "p",
Authenticator: AuthTypeOkta,
OktaURL: &url.URL{
Scheme: "https",
Host: "ac.some-host.com",
Path: "/custom-okta-url",
},
PrivateKey: testPrivKey,
Protocol: "http", Host: "ac.snowflake.local", Port: 9876,
OCSPFailOpen: OCSPFailOpenTrue,
ValidateDefaultParameters: ConfigBoolTrue,
ClientTimeout: defaultClientTimeout,
JWTClientTimeout: defaultJWTClientTimeout,
ExternalBrowserTimeout: defaultExternalBrowserTimeout,
IncludeRetryReason: ConfigBoolTrue,
},
ocspMode: ocspModeFailOpen,
err: nil,
},
{
dsn: fmt.Sprintf("u:[email protected]:9876?account=a&protocol=http&authenticator=SNOWFLAKE_JWT&privateKey=%v", privKeyPKCS1),
config: &Config{
Expand Down

0 comments on commit a95dd38

Please sign in to comment.