微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在新的 Spring Security 资源服务器定义中是否有等效的 ClientDetailsS​​ervice?

如何解决在新的 Spring Security 资源服务器定义中是否有等效的 ClientDetailsS​​ervice?

在 Spring Security OAuth(已弃用)中,您可以在定义资源服务器时指定 ClientDetailsS​​ervice。

<oauth:resource-server id="oauth2ResourceServerFilter" 
    token-services-ref="myResourcetokenServices"
    entry-point-ref="oauth2ResSvcAuthenticationEntryPoint" />

<b:bean id="myResourcetokenServices" 
      class="org.springframework.security.oauth2.provider.token.DefaultTokenServices">
    <b:property name="tokenStore" ref="myOAuth2TokenStore"/>
    <b:property name="clientDetailsService" ref="oauth2ResourceClientDetails"/>
</b:bean>

<oauth:client-details-service id="oauth2ResourceClientDetails">
    <oauth:client client-id="myClient" />
</oauth:client-details-service>

从我看到的代码可以看出,这将验证客户端 ID 并验证允许范围的列表。

在 Spring Security(OAuth2 的新实现)中有没有办法做到这一点???

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。