Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8ef830d

Browse files
[fix] Fixed the password encoder usage
1 parent 69a4fae commit 8ef830d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎d03/d03s02-spring-security/src/main/java/net/safedata/spring/training/d03/s01/config/SecurityConfiguration.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@
4040
@SuppressWarnings("unused")
4141
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
4242

43-
private static final String[] IGNORED_ENDPOINTS = {"/health", "/about"};
43+
private static final String[] IGNORED_ENDPOINTS = {"/info", "/about"};
4444

4545
@Autowired
4646
public void configureGlobal(final AuthenticationManagerBuilder auth) throws Exception {
4747
auth.inMemoryAuthentication()
4848
.passwordEncoder(passwordEncoder())
4949
.withUser("user")
50-
.password("password")
50+
// the unencrypted password is 'password'
51+
.password("2ドルa10ドル4ドルxnpk2a5jLr1mf6VWle6Vuv4q7DBsW2rqQcg6N1Ms/y4g98Ry4D4C")
5152
.roles(Roles.ADMIN_ROLE);
5253
}
5354

@@ -149,6 +150,7 @@ private void obtainAuthContext() {
149150
// obtaining the security context
150151
SecurityContext existingContext = SecurityContextHolder.getContext();
151152
final Authentication authentication = existingContext.getAuthentication();
152-
authentication.getDetails();
153+
final Object details = authentication.getDetails();
154+
System.out.println(details);
153155
}
154156
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /