Skip to content

Commit 98e75eb

Browse files
committed
Fix Javadoc for anonymous
1 parent 4fa1d08 commit 98e75eb

File tree

1 file changed

+23
-10
lines changed
  • config/src/main/java/org/springframework/security/config/annotation/web/builders

1 file changed

+23
-10
lines changed

config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java

+23-10
Original file line numberDiff line numberDiff line change
@@ -1611,14 +1611,18 @@ public HttpSecurity logout(Customizer<LogoutConfigurer<HttpSecurity>> logoutCust
16111611
* <pre>
16121612
* &#064;Configuration
16131613
* &#064;EnableWebSecurity
1614-
* public class AnononymousSecurityConfig extends WebSecurityConfigurerAdapter {
1614+
* public class AnonymousSecurityConfig extends WebSecurityConfigurerAdapter {
16151615
*
16161616
* &#064;Override
16171617
* protected void configure(HttpSecurity http) throws Exception {
1618-
* http.authorizeRequests().antMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;).and().formLogin()
1618+
* http
1619+
* .authorizeRequests()
1620+
* .antMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;)
16191621
* .and()
1620-
* // sample anonymous customization
1621-
* .anonymous().authorities(&quot;ROLE_ANON&quot;);
1622+
* .formLogin()
1623+
* .and()
1624+
* // sample anonymous customization
1625+
* .anonymous().authorities(&quot;ROLE_ANON&quot;);
16221626
* }
16231627
*
16241628
* &#064;Override
@@ -1635,14 +1639,18 @@ public HttpSecurity logout(Customizer<LogoutConfigurer<HttpSecurity>> logoutCust
16351639
* <pre>
16361640
* &#064;Configuration
16371641
* &#064;EnableWebSecurity
1638-
* public class AnononymousSecurityConfig extends WebSecurityConfigurerAdapter {
1642+
* public class AnonymousSecurityConfig extends WebSecurityConfigurerAdapter {
16391643
*
16401644
* &#064;Override
16411645
* protected void configure(HttpSecurity http) throws Exception {
1642-
* http.authorizeRequests().antMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;).and().formLogin()
1646+
* http
1647+
* .authorizeRequests()
1648+
* .antMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;)
1649+
* .and()
1650+
* .formLogin()
16431651
* .and()
1644-
* // sample anonymous customization
1645-
* .anonymous().disabled();
1652+
* // sample anonymous customization
1653+
* .anonymous().disable();
16461654
* }
16471655
*
16481656
* &#064;Override
@@ -1674,7 +1682,7 @@ public AnonymousConfigurer<HttpSecurity> anonymous() throws Exception {
16741682
* <pre>
16751683
* &#064;Configuration
16761684
* &#064;EnableWebSecurity
1677-
* public class AnononymousSecurityConfig extends WebSecurityConfigurerAdapter {
1685+
* public class AnonymousSecurityConfig extends WebSecurityConfigurerAdapter {
16781686
*
16791687
* &#064;Override
16801688
* protected void configure(HttpSecurity http) throws Exception {
@@ -1712,9 +1720,14 @@ public AnonymousConfigurer<HttpSecurity> anonymous() throws Exception {
17121720
* .formLogin(withDefaults())
17131721
* // sample anonymous customization
17141722
* .anonymous(anonymous ->
1715-
* anonymous.disabled()
1723+
* anonymous.disable()
17161724
* );
17171725
* }
1726+
*
1727+
* &#064;Override
1728+
* protected void configure(AuthenticationManagerBuilder auth) throws Exception {
1729+
* auth.inMemoryAuthentication().withUser(&quot;user&quot;).password(&quot;password&quot;).roles(&quot;USER&quot;);
1730+
* }
17181731
* }
17191732
* </pre>
17201733
*

0 commit comments

Comments
 (0)