This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- SAMPLE ENDPOINT ---- // | |
@RequestMapping(method = RequestMethod.GET, value = "users/{userId}") | |
Bookmark readUser(Principal principal, @PathVariable Long userId) { | |
return this.usersRepository.findOne(userId); | |
} | |
} | |
// ---- Configuration ---- // | |
@Configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
class WebSecurityConfiguration extends GlobalAuthenticationConfigurerAdapter { | |
@Autowired | |
AccountRepository accountRepository; | |
@Override | |
public void init(AuthenticationManagerBuilder auth) throws Exception { | |
auth.userDetailsService(userDetailsService()); | |
} |