如何为Spring授权服务器中的OAuth2ClientAuthenticationToken设置提供程序

huangapple go评论78阅读模式
英文:

How to set the provider for OAuth2ClientAuthenticationToken in Spring Authorization Server

问题

如何为OAuth2ClientAuthenticationToken对象设置提供程序类。

我正在使用Spring Security 5和Spring授权服务器版本0.3.1在Spring Boot上工作。
我已经配置了两者,但仍然遇到此错误。

是否可以提供一些关于如何执行此操作的示例链接。

错误:

org.springframework.security.authentication.ProviderNotFoundException: No AuthenticationProvider found for org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientAuthenticationToken
	at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:234)
	at org.springframework.security.oauth2.server.authorization.web.OAuth2ClientAuthenticationFilter.doFilterInternal(OAuth2ClientAuthenticationFilter.java:120)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
英文:

How can I set the provider class for OAuth2ClientAuthenticationToken object.

I am working on springboot using spring security 5 and Spring Authorization Server ver 0.3.1
I already make the configuration of both but still I encounter this error.

Can anybody provide some sample links on how to do such.

Error:

org.springframework.security.authentication.ProviderNotFoundException: No AuthenticationProvider found for org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientAuthenticationToken
	at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:234)
	at org.springframework.security.oauth2.server.authorization.web.OAuth2ClientAuthenticationFilter.doFilterInternal(OAuth2ClientAuthenticationFilter.java:120)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
	at 

答案1

得分: 1

查看配置客户端身份验证的参考文档。

英文:

See Configuring Client Authentication in the reference.

huangapple
  • 本文由 发表于 2023年3月8日 15:23:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75670279.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定