Skip to content

Commit

Permalink
Customize csrf cookie domain (#7184)
Browse files Browse the repository at this point in the history
* Update the csrfTokenRepo bean so we can configure the cookie domain

* Use the factory method to set the httpcookie setting
  • Loading branch information
amontenegro authored Jan 16, 2025
1 parent c9aef14 commit 12d379a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions orcid-web/src/main/resources/orcid-frontend-security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@
</bean>
</property>
</bean>

<bean id="csrfTokenRepo" class="org.springframework.security.web.csrf.CookieCsrfTokenRepository" factory-method="withHttpOnlyFalse" />

<sec:http-firewall ref="httpFirewall"/>

<bean id="csrfTokenRepo" class="org.springframework.security.web.csrf.CookieCsrfTokenRepository" factory-method="withHttpOnlyFalse">
<property name="cookieDomain" value="${org.orcid.core.csrf.domain}" />
</bean>

<sec:http-firewall ref="httpFirewall"/>

<sec:http pattern="/robots.txt" security="none" create-session="stateless" />
<sec:http pattern="/tomcatUp.json" security="none" create-session="stateless" />
Expand Down

0 comments on commit 12d379a

Please sign in to comment.