<VirtualHost *:80>
  DocumentRoot /opt/observium/html/
  ServerName  observium.grapeshot.com
  ErrorLog /opt/observium/logs/error_log

  <IfModule auth_openidc_module>
    OIDCProviderMetadataURL https://accounts.google.com/.well-known/openid-configuration
    OIDCClientID  987238408723-ia3vk0kv85a661fb4be4f36b5t3ogiqs.apps.googleusercontent.com
    OIDCClientSecret -xfVO5aDXf1rZeXQOcehKaxh
    OIDCRedirectURI http://observium.grapeshot.com/login/
    OIDCDefaultURL http://observium.grapeshot.com/login/
    OIDCCryptoPassphrase idontknow
    OIDCAuthRequestParams hd=grapeshot.co.uk
    OIDCScope "openid email"
    # From:http://www.boxever.com/using-google-apps-openid-connect-with-apache/
    # Set REMOTE_USER to the email address.
    OIDCRemoteUserClaim email
    OIDCScope "email openid"
  </IfModule>

  SetEnvIf Request_URI ^/healthcheck$ healthcheck
  LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Forwarded-For}i\"" oauthlog
  CustomLog /opt/observium/logs/access_log oauthlog env=!healthcheck

  <Directory "/opt/observium/html/">
    AllowOverride All
    Options FollowSymLinks MultiViews

    <IfModule auth_openidc_module>
      AuthType openid-connect
      Require claim hd:grapeshot.co.uk issued_to:987238408723-ia3vk0kv85a661fb4be4f36b5t3ogiqs.apps.googleusercontent.com
    </IfModule>
  </Directory>
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot /opt/observium/html/
  ServerName observium.cambridge.grapeshot.co.uk
  ErrorLog /opt/observium/logs/error_log

  SetEnvIf Request_URI ^/healthcheck$ healthcheck
  LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Forwarded-For}i\"" oauthlog
  CustomLog /opt/observium/logs/access_log oauthlog env=!healthcheck

  <Directory "/opt/observium/html/">
    AllowOverride All
    Options FollowSymLinks MultiViews
    Require all granted
  </Directory>
</VirtualHost>

