Skip to content

OidcUserInfoAuthenticationProvider doesn't support for opaque token bearer authorization #1865

Closed
@malvinpatrick

Description

@malvinpatrick

I have pull your sample project "demo-authorization server", and I tried to use registered client with opaque token. After I input username and password, BFF spring security tries to call "/userinfo" on DefaultOAuth2UserService. But I got JWT malformat exception on authorization server. So I tried to debug which code generates an error. And I got the error was raised from JwtAuthenticationProvider.

I've seen your response on Issue 1330, you said that OidcUserInfoAuthenticationProvider can handle bearer token with opaque token.

I have debug list of provider for ProviderManager
image

On OidcUserInfoAuthenticationProvider, there's a code for check supports

@Override
	public boolean supports(Class<?> authentication) {
		return OidcUserInfoAuthenticationToken.class.isAssignableFrom(authentication);
	}

which always return false because authentication class is a sub class of BearerTokenAuthenticationToken, construct by BearerTokenAuthenticationFilter-doFilterInternal

My question is how to call /userinfo by using Opaque Token Bearer Authorization?

Metadata

Metadata

Assignees

Labels

for: stackoverflowA question that's better suited to stackoverflow.com

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions