Skip to content

Instantly share code, notes, and snippets.

@sigmunau
Last active January 17, 2017 08:52
Show Gist options
  • Save sigmunau/088edb9c0a26ee6136f21401ecb385af to your computer and use it in GitHub Desktop.
Save sigmunau/088edb9c0a26ee6136f21401ecb385af to your computer and use it in GitHub Desktop.
Example site configuration using apache mod_auth_openidc and dataporten
<VirtualHost www.example.org>
ServerAdmin webmaster@example.org
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# OpenID Connect metadata for dataporten.
OIDCProviderMetadataURL https://auth.dataporten.no/.well-known/openid-configuration
OIDCSSLValidateServer On
# These are Client ID and Client Secret from the OAuth details page on dashboard.dataporten.no
OIDCClientID e3e41c40-01e4-4b9c-b0c4-018ea7aa1273
OIDCClientSecret 8a00bafa-4983-4458-a9e3-28e9e5778dd0
# Scopes to request. These must be activated in dashboard.dataporten.no first
OIDCScope "openid email"
# Session cookie encryption key
OIDCCryptoPassphrase GenerateNewPassword
# Try uncommenting this if you get errors like these "OpenID Connect Provider error: Error in handling response type."
# OIDCProviderTokenEndpointAuth client_secret_post
# Needs to match exactly redirect URI registered in dashboard.dataporten.no
OIDCRedirectURI https://www.example.org/redirect_uri
<Location "/">
AuthType openid-connect
Require valid-user
</Location>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment