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

feat: add option for insecure service account authentication #848

Merged
merged 2 commits into from
Dec 19, 2023
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
7 changes: 6 additions & 1 deletion src/Zitadel/Credentials/ServiceAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public async Task<string> AuthenticateAsync(string audience, AuthOptions? authOp
var manager = new ConfigurationManager<OpenIdConnectConfiguration>(
authOptions.DiscoveryEndpoint ?? DiscoveryEndpoint(audience),
new OpenIdConnectConfigurationRetriever(),
new HttpDocumentRetriever(HttpClient));
new HttpDocumentRetriever(HttpClient) { RequireHttps = authOptions.RequireHttps ?? true });

var oidcConfig = await manager.GetConfigurationAsync();

Expand Down Expand Up @@ -246,6 +246,11 @@ public record AuthOptions
/// </summary>
public string? DiscoveryEndpoint { get; init; }

/// <summary>
/// Requires Https secure channel for sending requests. This is turned ON by default for security reasons. It is RECOMMENDED that you do not allow retrieval from http addresses by default.
/// </summary>
public bool? RequireHttps { get; init; }

/// <summary>
/// Set a list of roles that must be attached to this service account to be
/// successfully authenticated. Translates to the role scope ("urn:zitadel:iam:org:project:role:{Role}").
Expand Down