第二次连续调用后,从资源服务器对授权服务器的内省调用失败
连续2次尝试后,内省的失败。 错误:内省端点响应无效,因为内容型'text/html'与json在org.springframework.security.oauth.server.server.sererce.authentication.opaqueatokeationalauthationauthationauthication provider.getOauthententicprovider.getOauthententenentIcatiCatecticatecticatecticatecticatecticatecticatecticatecticatecticatecticatecticatecticatecticatecticatecticpple
正在使用:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests(authz -> authz
.antMatchers(HttpMethod.GET, "/bars/**").hasAuthority("SCOPE_read")
.antMatchers(HttpMethod.POST, "/bars").hasAuthority("SCOPE_write")
.anyRequest().authenticated())
.oauth2ResourceServer(oauth2 -> oauth2
.opaqueToken(token -> token.introspectionUri(this.introspectionUri)
.introspectionClientCredentials(this.clientId, this.clientSecret)));
}
Introspect is failing after 2 successive attempts.
Error : Introspect endpoint response was invalid,as content-type 'text/html' is not compatible with JSON at org.springframework.security.oauth.server.resource.authentication.OpaqueaTokenAuthenticationProvider.getOAuth2Authenticatedprincple
this is the sample code we are using:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests(authz -> authz
.antMatchers(HttpMethod.GET, "/bars/**").hasAuthority("SCOPE_read")
.antMatchers(HttpMethod.POST, "/bars").hasAuthority("SCOPE_write")
.anyRequest().authenticated())
.oauth2ResourceServer(oauth2 -> oauth2
.opaqueToken(token -> token.introspectionUri(this.introspectionUri)
.introspectionClientCredentials(this.clientId, this.clientSecret)));
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论