Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed okta authenticator to support format https://vanity.url.com/snowflake/okta #365

Merged
merged 1 commit into from
Sep 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Snowflake.Data/Core/Authenticator/IAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ protected void Login()
}

/// <summary>
/// Specialized authenticator data to add to the login request.
/// Specialized authenticator data to add to the login request.
/// </summary>
/// <param name="data">The login request data to update.</param>
protected abstract void SetSpecializedAuthenticatorData(ref LoginRequestData data);

/// <summary>
/// Builds a simple login request. Each authenticator will fill the Data part with their
/// specialized information. The common Data attributes are already filled (clientAppId,
/// specialized information. The common Data attributes are already filled (clientAppId,
/// ClienAppVersion...).
/// </summary>
/// <returns>A login request to send to the server.</returns>
Expand Down Expand Up @@ -181,9 +181,8 @@ internal static IAuthenticator GetAuthenticator(SFSession session)

return new OAuthAuthenticator(session);
}
// Okta would provide a url of form: https://xxxxxx.okta.com or https://xxxxxx.oktapreview.com
else if ((type.EndsWith("okta.com") || type.EndsWith("oktapreview.com") )
&& type.StartsWith("https://"))
// Okta would provide a url of form: https://xxxxxx.okta.com or https://xxxxxx.oktapreview.com or https://vanity.url/snowflake/okta
else if (type.Contains("okta") && type.StartsWith("https://"))
{
return new OktaAuthenticator(session, type);
}
Expand Down