【问题标题】:I'm very new to the spring security and OAuth2我对 Spring Security 和 OAuth2 很陌生
【发布时间】:2016-02-08 05:27:50
【问题描述】:

您好,我是 Spring Security 的新手,OAUTH2 可以帮助任何人......我正在使用此示例中提供的示例 http://www.beingjavaguys.com/2014/10/spring-security-oauth2-integration.html

我要做的是创建 2 个 Web 应用程序,其中一个应用程序(mainApp)存储所有受保护的资源并且不了解用户,它需要对另一个应用程序进行休息调用以获取详细信息

目前在我的安全配置中

<authentication-manager id="clientAuthenticationManager"
        xmlns="http://www.springframework.org/schema/security">
        <authentication-provider user-service-ref="clientDetailsUserService" />
    </authentication-manager>

    <authentication-manager alias="authenticationManager"
        xmlns="http://www.springframework.org/schema/security">
        <authentication-provider>
            <user-service>
                <user name="abcd" password="1234" authorities="ROLE_APP" />
            </user-service>
        </authentication-provider>
    </authentication-manager>

在我的例子中,我想让我们在另一个应用程序中的自定义 API 进行身份验证,然后返回一个包含角色和其他属性的自定义 UserDetails 对象

【问题讨论】:

  • 有什么问题?请尽可能明确地告诉我们您遇到了什么问题,包括您可能收到的任何错误消息。

标签: spring security spring-mvc spring-security oauth-2.0


【解决方案1】:

您是否尝试关注https://spring.io/guides/tutorials/spring-security-and-angular-js/#_sso_with_oauth2_angular_js_and_spring_security_part_v?我认为该指南非常有趣,并提供了实施 OAuth2 和其他安全方法的广泛视角。是否有任何理由因为您需要使用 OAuth2?我的意思是,您可以在开始使用 OAuth2 之前开始使用基本授权或基于令牌的方法(如果您没有太多经验,这可能会很复杂)。

【讨论】:

  • 我有一个要求,我需要实现 Spring Security。
  • 谢谢你的例子......实际上我已经经历过我必须使用xml配置而不是java配置
猜你喜欢
  • 2015-07-23
  • 2022-06-17
  • 2019-09-25
  • 1970-01-01
  • 1970-01-01
  • 2014-11-07
  • 1970-01-01
  • 2017-09-01
  • 2016-09-22
相关资源
最近更新 更多