Skip to content

Commit

Permalink
Merge pull request #282 from jvlcek/oidc_to_httpd_config_issue_19866
Browse files Browse the repository at this point in the history
Move API OpenID-Connect support to Apache configuration

(cherry picked from commit 34c78fd)
  • Loading branch information
Fryguy authored and simaishi committed May 12, 2020
1 parent e528dd0 commit 5a9e445
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions TEMPLATE/etc/httpd/conf.d/manageiq-external-auth-openidc.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,36 @@ LoadModule auth_openidc_module modules/mod_auth_openidc.so
ServerName https://<%= miq_appliance %>
LogLevel warn

OIDCProviderMetadataURL <%= oidc_provider_metadata_url %>
OIDCCLientID <%= oidc_client_id %>
OIDCClientSecret <%= oidc_client_secret %>
OIDCRedirectURI https://<%= miq_appliance %>/oidc_login/redirect_uri
OIDCCryptoPassphrase sp-cookie
OIDCOAuthRemoteUserClaim username
OIDCProviderMetadataURL <%= oidc_provider_metadata_url %>
OIDCCLientID <%= oidc_client_id %>
OIDCClientSecret <%= oidc_client_secret %>
OIDCRedirectURI https://<%= miq_appliance %>/oidc_login/redirect_uri
OIDCCryptoPassphrase sp-cookie
OIDCOAuthRemoteUserClaim username
OIDCOAuthClientID <%= oidc_client_id %>
OIDCOAuthClientSecret <%= oidc_client_secret %>
OIDCOAuthIntrospectionEndpoint <%= oidc_introspection_endpoint %>
OIDCOAuthIntrospectionEndpointAuth client_secret_basic

<Location /oidc_login>
AuthType openid-connect
Require valid-user
</Location>

<LocationMatch ^/api(?!\/(v[\d\.]+\/)?product_info$)>
SetEnvIf Authorization '^Basic +YWRtaW46' let_admin_in
SetEnvIf X-Auth-Token '^.+$' let_api_token_in
SetEnvIf X-MIQ-Token '^.+$' let_sys_token_in
SetEnvIf X-CSRF-Token '^.+$' let_csrf_token_in

AuthType oauth20
AuthName "External Authentication (oidc) for API"

Require valid-user
Order Allow,Deny
Allow from env=let_admin_in
Allow from env=let_api_token_in
Allow from env=let_sys_token_in
Allow from env=let_csrf_token_in
Satisfy Any
</LocationMatch>

0 comments on commit 5a9e445

Please sign in to comment.