Skip to content

Allow setting Oauth 2.0 Resource Indicators in Oauth client calls #16605

@pat-mccusker

Description

@pat-mccusker

Expected Behavior

Allow the setting of Resource Indicators for Oauth 2.0 on ClientRegistration to then be used for authentication requests.

Current Behavior

The current process for setting an RFC 8707 resource indicator might appear to be begin with either

  1. Implementing a custom Oauth2AuthorizedClientManager and in the authorize method adding the indicator as a custom attribute entry to the Oauth2AuthorizationContext.
  2. Instantiating an existing Oauth2AuthorizedClientManager implementation and setting a contextAttributesMapper on that instance that would create the resource indicator entry.

However, it seems that this value would ultimately not be applied by a parametersConverter such as the OAuth2ClientCredentialsGrantRequestEntityConverter, so quite a bit more custom work appears to be necessary.

Context

My specific case involves a client credentials flow involving a resource indicator rather than core oauth 2 scopes, using WebClient and a ServletOAuth2AuthorizedClientExchangeFilterFunction. I'm also leveraging spring-boot oauth client autoconfiguration properties, but as that project's property values are applied to spring-security ClientRegistrations starting here seems to make the most sense.

The only existing issues involving resource indicators that I'm aware of are this project's #6972 and the spring-authorization-server project's support request.

Are there any other workarounds that I'm unaware of?

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions