chore: add client_secret and client_authentication env variables#2991
Open
Braden-OBrien wants to merge 1 commit into
Open
chore: add client_secret and client_authentication env variables#2991Braden-OBrien wants to merge 1 commit into
Braden-OBrien wants to merge 1 commit into
Conversation
implementing quick fixes for opencloud-eu#2345
Up to standards ✅🟢 Issues
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added additional values to the OIDC Web config such that the /config.json options are passed on to the frontend.
json:"client_secret,omitempty" yaml:"client_secret" env:"OC_OIDC_CLIENT_SECRET;WEB_OIDC_CLIENT_SECRET"
client_secret option used by oidc-client-ts to provide the client_secret to OAuth endpoint during code exchange. Despite PKCE, some external IDPs demand that the client secret be provided regardless, sort of as another client_id. Allows some new IDPs to be compatible with OpenCloud (such as Google OAuth).
json:"client_authentication,omitempty" yaml:"client_authentication" env:"WEB_OIDC_CLIENT_AUTHENTICATION"
"client_secret_xx" option used by oidc-client-ts to specify whether the client_id and client_secret are provided to the OAuth endpoint as a basic authentication header (client_secret_basic), included in the POST headers (client_secret_post), or as a JWT (client_secret_JWT).
Both can be added as environment variables or using the existing WEB_UI_CONFIG_FILE json option.
Related Issue
Motivation and Context
Certain external IDP configurations are verify specific - particularly with requesting the client_secret regardless of PKCE. This is a simple addition to the configuration that extends the possibilities to configure an external IDP.
Enables a couple more of the options described on the Web documentation that were being improperly passed on to the web frontend because the JSON unmarshaler failed to unmarshal into the Web.Config.OpenIDConnect struct.
How Has This Been Tested?
Debian 13 bare-metal install
Google Accounts as OAuth/OIDC provider
Tested successful delivery of client secret via both client_secret_basic and client_secret_post configurations.
Screenshots (if appropriate):
WEB_OIDC_CLIENT_AUTHENTICATION="client_secret_post"


WEB_OIDC_CLIENT_AUTHENTICATION="client_secret_basic"
Also implemented small unit test /services/web/pkg/config/oidc_config_test.go to test the successful parsing of environment variables into struct
Running tool: /usr/local/go/bin/go test -test.fullpath=true -timeout 30s -run ^TestOIDCWebConfiguration$ github.com/opencloud-eu/opencloud/services/web/pkg/config
As well as existing test suite for config and webfinger discovery (relations)
Types of changes
Checklist: