在spring security中配置默认​​用户

发布于 2024-11-25 08:39:45 字数 171 浏览 7 评论 0原文

有没有办法配置 spring security 来拥有默认用户(具有角色等)?我想在嵌入式码头环境中使用它进行测试。

我提供了一个 InMemoryUserDetailsS​​ervice 但我缺少告诉 spring security 使用哪个用户的部分。

谢谢你的帮助

,法比安

is there a way to configure spring security to have a default user (with roles and such)? i want to use it for testing purposes in an embedded jetty environment.

i provided an InMemoryUserDetailsService but i am missing the part where i tell spring security to use which user.

thanks for your help

fabian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

童话里做英雄 2024-12-02 08:39:45

您是指匿名用户吗?

如果是这样,请尝试以下操作: http://static .springsource.org/spring-security/site/docs/3.0.x/reference/anonymous.html

(“Spring Security 的匿名身份验证只是为您提供了更多
配置访问控制属性的便捷方法”)

Do you mean an anonymous user?

If so, try this: http://static.springsource.org/spring-security/site/docs/3.0.x/reference/anonymous.html

("Spring Security's anonymous authentication just gives you a more
convenient way to configure your access-control attributes")

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文