Skip to content

Commit

Permalink
[#3283] Ability to configure the auth entrypoint via properties
Browse files Browse the repository at this point in the history
* Together with @dlebrero we managed to simplify the code and
  use `System.properties` (defined in `appengine-web.xml`) and
  override the default authentication entrypoint `oidc` with `gae`
  • Loading branch information
iperdomo committed Jan 16, 2020
1 parent 90124f0 commit 9547b9d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 55 deletions.
48 changes: 0 additions & 48 deletions GAE/src/org/akvo/flow/rest/security/EntryPoint.java

This file was deleted.

9 changes: 2 additions & 7 deletions GAE/war/WEB-INF/webapp-security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<b:constructor-arg ref="oidcConfig"/>
</b:bean>

<http use-expressions="true" entry-point-ref="defaultEntryPoint" authentication-manager-ref="authenticationManager"
access-decision-manager-ref="accessDecisionManager">
<http use-expressions="true" entry-point-ref="#{systemProperties['authEntryPoint'] ?: 'oidcEntryPoint'}"
authentication-manager-ref="authenticationManager" access-decision-manager-ref="accessDecisionManager">
<headers>
<frame-options policy="SAMEORIGIN" />
</headers>
Expand Down Expand Up @@ -87,9 +87,4 @@

<b:bean id="gaeAuthenticationProvider" class="org.akvo.flow.rest.security.google.GoogleAccountsAuthenticationProvider" />

<b:bean id="defaultEntryPoint" class="org.akvo.flow.rest.security.EntryPoint">
<b:constructor-arg ref="oidcEntryPoint"/> <!-- production -->
<b:constructor-arg ref="gaeEntryPoint"/> <!-- development -->
</b:bean>

</b:beans>
1 change: 1 addition & 0 deletions tests/dev-appengine-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
<property name="serviceAccountId" value="sa-akvoflowsandbox@akvoflowsandbox.iam.gserviceaccount.com"/>
<property name="hereMapsAppId" value="none"/>
<property name="hereMapsAppCode" value="neither"/>
<property name="authEntryPoint" value="gaeEntryPoint"/>
</system-properties>
</appengine-web-app>

0 comments on commit 9547b9d

Please # to comment.