14 Commits

Author SHA1 Message Date
Rodrigo Barbieri
4b38b5ed26 Add semicolon claim delimiter config in apache2 plugin
By default the oidc apache2 plugin uses
comma, but Keystone expects a semicolon [1,2].

This is necessary when writing multi-valued
data (such as OIDC-groups) for Keystone to consume.

[1] 187bcad522/keystone/federation/utils.py (L515)
[2] https://docs.openstack.org/keystone/latest/admin/federation/mapping_combinations.html#mappings-examples

Closes-bug: #2085727
Change-Id: I179ac68a463866c4efaa7c9259a247bf4dc3b573
2025-02-24 08:41:56 -03:00
Bartosz Woronicz
7e375d1fb8 add ability to manage OIDCResponseType
In the certains situation customers using tools like Authentik or
Zitadel may encounter issue with using id_token as in that case it may
also return access_token despite not set deliberately
The `code` flow is now the preffered approach for OIDC hence
the ability for setting that options gives more flexibility.

Implements: oidc-response-type option
Closes-Bug: #2084184
Change-Id: I251dffbdf97998998066d5efd2d8d9386ecd19e5
2024-10-23 15:37:39 +02:00
Jadon Naas
da043cb293 Fix reversed values, add config options
The values of the protocol ID and identity provider ID are
reversed in the charm's code. This causes the mod_auth_openidc
config to render incorrectly in the Apache template. This change
fixes the reversed values and adds a config option for
defining the identity provider ID. This change also adds new
config options for enabling using mod_auth_openidc with
multiple Keystone units and with proxies.

Closes-Bug: #2065590
Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1235
Change-Id: Ie7da5f9a85027a287aad9958c54848a948f8495c
2024-06-28 19:44:43 +00:00
Felipe Reyes
10c79bde63 Add property oauth_introspection_endpoint
The property oauth_introspection_endpoint reads from the metadata url to
determine the introspection endpoint when not passed explicitly in the
configuration.

This patch includes various fixes to make the hooks execution more
robust.
2022-09-08 23:17:00 -04:00
Felipe Reyes
615b27a4a2 Fix typo in apache template 2022-08-19 15:52:18 -04:00
Felipe Reyes
f93b4451fb Add OIDCOAuth config to Apache.
This change introduces the configuration of OAuth to enable auth-openidc
which is browser-less.

When enable-oauth is set to true (the default) and
oidc-auth-verify-jwks-uri is empty, the charm will try use
oidc-oauth-introspection-endpoint if set, otherwise the charm will fetch
the content at oidc-provider-metadata-url and use the value available at
the key introspection_endpoint.
2022-08-16 10:44:26 -04:00
Felipe Reyes
8af65a0514 Add debug config option
This config option enables debug logging for the configured
LocationMatch section in Apache.
2022-08-09 13:19:54 -04:00
Felipe Reyes
2262180c76 Add oidc-remote-user-claim config option.
This configuration option allows the operator to override what claim
must be set in the REMOTE_USER environment variable which it's used by
Keystone to determine the username unless the mapping rules use a
different field.
2022-08-09 11:01:30 -04:00
Felipe Reyes
d4cbed3de8 Add protocol-id configuration option
The protocol-id is how the charm will present itself to keystone and
make it include a section in keystone.conf with its name.

The template is updated to make the URLs include this information in
their path.
2022-08-09 10:59:04 -04:00
Felipe Reyes
c22b9d2d4d Add oidc-client-secret config option
This configuration option allows the client (Apache) to authenticate
against the Identity Provider, this is needed for non-public providers.
2022-08-09 10:50:48 -04:00
Felipe Reyes
82b2d440db Add auth-type config option
To allow non browser based applications (e.g. OpenStack CLI)
authenticate type needs to be set to 'auth-openidc' (the default).
2022-08-09 10:40:53 -04:00
Felipe Reyes
4314542a26 Render apache2 configuration file from the configuration adapter 2022-07-26 18:29:13 -04:00
Felipe Reyes
1ddc96b70a Generate crypto passphrase if needed.
The crypto passphrase is stored in the application data bag, when not
found the leader will generate it and store it, this will allow the
followers to read it on the relation changed.
2022-07-22 12:07:49 -04:00
Felipe Reyes
205ca9534d Implement KeystoneOpenIDCCharm.render_config()
This method renders the needed configuration files.
2022-07-21 19:13:15 -04:00