Class RequestAttributePrincipalResolver
java.lang.Object
org.springframework.security.oauth2.client.web.client.RequestAttributePrincipalResolver
- All Implemented Interfaces:
OAuth2ClientHttpRequestInterceptor.PrincipalResolver
public class RequestAttributePrincipalResolver
extends Object
implements OAuth2ClientHttpRequestInterceptor.PrincipalResolver
A strategy for resolving a
principal
from an intercepted request
using attributes
.- Since:
- 6.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprincipal
(Authentication principal) resolve
(org.springframework.http.HttpRequest request) Resolve theprincipal
from the current request, which is used to obtain anOAuth2AuthorizedClient
.
-
Constructor Details
-
RequestAttributePrincipalResolver
public RequestAttributePrincipalResolver()
-
-
Method Details
-
resolve
Description copied from interface:OAuth2ClientHttpRequestInterceptor.PrincipalResolver
Resolve theprincipal
from the current request, which is used to obtain anOAuth2AuthorizedClient
.- Specified by:
resolve
in interfaceOAuth2ClientHttpRequestInterceptor.PrincipalResolver
- Parameters:
request
- the intercepted request, containing HTTP method, URI, headers, and request attributes- Returns:
- the
principal
to be used for resolving anOAuth2AuthorizedClient
.
-
principal
- Parameters:
principal
- theprincipal
to be used to look up theOAuth2AuthorizedClient
- Returns:
- the
Consumer
to populate the attributes
-
principal
- Parameters:
principalName
- theprincipalName
to be used to look up theOAuth2AuthorizedClient
- Returns:
- the
Consumer
to populate the attributes
-