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

Support SSO provider config from infrahub.toml #4749

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Oct 26, 2024

This is an alternate approach to #4739.

The main change is to enforce the same type of settings as we can to with environment variables. So an updated infrahub.toml file would look like this:

[security]

# Just like when using environment variables we require a configured provider
# to be enabled in the config
oauth2_providers = ["provider1", "google"] <- required
oidc_providers = ["provider1", "provider2", "google"] <- required

# only supported names are "provider1", "provider2" and "google"
[security.oauth2_provider_settings.provider1] 
client_id = "your-client-id-1"
client_secret = "your-client-secret-1"
authorization_url = "https://example.com/oauth2/authorize"
token_url = "https://example.com/oauth2/token"
userinfo_url = "https://example.com/oauth2/userinfo"
scopes = ["openid", "profile", "email"]
display_label = "Provider 1"

[security.oauth2_provider_settings.google]
client_id = "your-client-id-2"
client_secret = "your-client-secret-2"

[security.oidc_provider_settings.provider1]
client_id = "your-client-id-1"
client_secret = "your-client-secret-1"
discovery_url = "https://example.com/oicd/discovery"
icon = "mdi:account"
display_label = "Provider 1 (OIDC)"

[security.oidc_provider_settings.provider2]
client_id = "your-client-id-1"
client_secret = "your-client-secret-1"
discovery_url = "https://example.com/oicd/discovery"
icon = "mdi:server"
display_label = "Provider 2 (OIDC)"

[security.oidc_provider_settings.google]
client_id = "your-client-id-1"
client_secret = "your-client-secret-1"

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Oct 26, 2024
@ogenstad ogenstad force-pushed the pog-sso-infrahub-toml branch 2 times, most recently from 5b55ac2 to cdfac0a Compare October 26, 2024 18:02
@ogenstad ogenstad marked this pull request as ready for review October 26, 2024 19:47
@ogenstad ogenstad requested a review from a team October 26, 2024 19:47
Copy link
Collaborator

@dgarros dgarros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add something to the doc while you're at it

@github-actions github-actions bot added the type/documentation Improvements or additions to documentation label Oct 28, 2024
@ogenstad
Copy link
Contributor Author

Added suggested changes for documentation.

@ogenstad ogenstad merged commit 56dfb3c into release-1.0 Oct 28, 2024
31 checks passed
@ogenstad ogenstad deleted the pog-sso-infrahub-toml branch October 28, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants