Skip to content

Commit 6253cc5

Browse files
committed
Merge branch '1.1.x'
2 parents 67ec89e + df81b31 commit 6253cc5

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ public class AuthenticationManagerConfiguration {
6969

7070
@Bean
7171
@Primary
72-
public AuthenticationManager authenticationManager(AuthenticationConfiguration auth) throws Exception {
72+
public AuthenticationManager authenticationManager(AuthenticationConfiguration auth)
73+
throws Exception {
7374
return auth.getAuthenticationManager();
7475
}
7576

7677
@Bean
77-
public static BootDefaultingAuthenticationConfigurerAdapter bootDefaultingAuthenticationConfigurerAdapter(SecurityProperties security,
78-
List<SecurityPrerequisite> dependencies) {
78+
public static BootDefaultingAuthenticationConfigurerAdapter bootDefaultingAuthenticationConfigurerAdapter(
79+
SecurityProperties security, List<SecurityPrerequisite> dependencies) {
7980
return new BootDefaultingAuthenticationConfigurerAdapter(security);
8081
}
8182

@@ -126,14 +127,16 @@ public void afterSingletonsInstantiated() {
126127
* </ul>
127128
*/
128129
@Order(Ordered.LOWEST_PRECEDENCE - 100)
129-
private static class BootDefaultingAuthenticationConfigurerAdapter extends GlobalAuthenticationConfigurerAdapter {
130+
private static class BootDefaultingAuthenticationConfigurerAdapter extends
131+
GlobalAuthenticationConfigurerAdapter {
130132
private final SecurityProperties security;
131133

132134
@Autowired
133135
public BootDefaultingAuthenticationConfigurerAdapter(SecurityProperties security) {
134136
this.security = security;
135137
}
136138

139+
@Override
137140
public void init(AuthenticationManagerBuilder auth) throws Exception {
138141
if (auth.isConfigured()) {
139142
return;
@@ -144,12 +147,13 @@ public void init(AuthenticationManagerBuilder auth) throws Exception {
144147
logger.info("\n\nUsing default security password: " + user.getPassword()
145148
+ "\n");
146149
}
150+
147151
Set<String> roles = new LinkedHashSet<String>(user.getRole());
148-
auth
149-
.inMemoryAuthentication()
150-
.withUser(user.getName())
151-
.password(user.getPassword())
152-
.roles(roles.toArray(new String[roles.size()]));
152+
auth.inMemoryAuthentication().withUser(user.getName())
153+
.password(user.getPassword())
154+
.roles(roles.toArray(new String[roles.size()]));
153155
}
156+
154157
}
155-
}
158+
159+
}

0 commit comments

Comments
 (0)