Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #211 from hkeeler/login-action-messages
Browse files Browse the repository at this point in the history
Improve logs in auth-proxy and keycloak
  • Loading branch information
kgudel authored Jan 18, 2018
2 parents f9cb9ba + 7a626fb commit 696f75f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 2 additions & 9 deletions auth-proxy/conf/etc/httpd/conf.d/01-auth-proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ Listen 8080
AuthName "OpenID Connect (HMDA Ops)"
Require valid-user

LogMessage "REMOTE_USER: %{REMOTE_USER}" hook=check_authz

ProxyPass ${FILING_API_UPSTREAM_URI}
ProxyPassReverse ${FILING_API_UPSTREAM_URI}


# We have encountered the following warning from our akka-http based APIs:
# Illegal 'x-forwarded-host' header: Invalid input ' '
# This is caused by a space character being added to the comma-separated list
Expand All @@ -45,10 +42,8 @@ Listen 8080
<Location "/">

# CORS Preflight
# SEE: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests
# SEE: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests
<If "%{REQUEST_METHOD} == 'OPTIONS' && %{HTTP:Origin} != '' && %{HTTP:Access-Control-Request-Headers} != '' && %{HTTP:Access-Control-Request-Method} != ''">
LogMessage "CORS Preflight - Origin: %{req:Origin}; Headers: %{req:Access-Control-Request-Headers}; Methods: %{req:Access-Control-Request-Method}"

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods: "GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD"
Header always set Access-Control-Allow-Headers: "Authorization, Cache-Control, Accept, Content-Type"
Expand All @@ -62,9 +57,7 @@ Listen 8080
RewriteRule ^(.*)$ $1 [R=204,L]
</If>
<ElseIf "%{HTTP:Origin} != ''">
LogMessage "CORS Request - Origin: %{req:Origin}"

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Origin "*"
</ElseIf>

</Location>
Expand Down
9 changes: 9 additions & 0 deletions keycloak/standalone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,15 @@
<cacheTemplates>false</cacheTemplates>
<dir>${jboss.home.dir}/themes</dir>
</theme>
<spi name="eventsListener">
<provider name="jboss-logging" enabled="true">
<properties>
<!-- Overrides DEBUG default, allowing ALL events to be logged -->
<property name="success-level" value="INFO"/>
<property name="error-level" value="WARN"/>
</properties>
</provider>
</spi>
<spi name="eventsStore">
<provider name="jpa" enabled="true">
<properties>
Expand Down

0 comments on commit 696f75f

Please sign in to comment.