> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/ix.-how-to-guides/84.-security/84.2-change-the-authenticationmanager-and-add-user-accounts.md).

# 84.2 改变AuthenticationManager并添加用户账号

如果你提供了一个`AuthenticationManager`、`AuthenticationProvider`、`UserDetailsService`类型的`@Bean`，那么默认的用于`InMemoryUserDetailsManager`的`@Bean`就不会被创建了，所以你可以获得Spring Security可用的全部特性（比如，[不同的认证选项](https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#jc-authentication)）。

添加用户帐户的最简单方法是提供你自己的`UserDetailsService` bean。
