Can't use an alternative optionsProvider with ClientCredentials grant type

Created on 6 June 2024, 22 days ago
Updated 13 June 2024, 15 days ago

Problem/Motivation

While attempting to create a oauth plugin using a grant type of client_credentials and the HttpBasicAuthOptionProvider from League, i found that the ClientCredentials class always overwrites this with the built in ClientCredentialsOptionProvider, which isn't working for my situation where I need to pass the Authentication header with credentials.

Proposed resolution

In the ClientCredential class test for the OptionsProviderInterface rather than a specific instance of the ClientCredentialsOptionProvider. I'll submit a merge request of the proposed changes

πŸ’¬ Support request
Status

Closed: works as designed

Version

4.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jonathanchris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jonathanchris
  • Status changed to Postponed: needs info 22 days ago
  • πŸ‡ΊπŸ‡ΈUnited States FatherShawn New York

    Does the approach outlined in πŸ’¬ OptionProvidor overruled Closed: works as designed not meet your needs?

  • πŸ‡ΊπŸ‡ΈUnited States jonathanchris

    Thanks for such a quick reply. Wow I can't believe I didn't think of just extending the ClientCredentialsOptionProvider. I think that will work, but I do think you could just check if the instance was League\OAuth2\Client\OptionProvider\OptionProviderInterface, that way you could use their classes as well. That said, I'll just extend the ClientCredentialsOptionProvider and that should do the trick.

  • Status changed to Closed: works as designed 15 days ago
  • πŸ‡ΊπŸ‡ΈUnited States FatherShawn New York
Production build 0.69.0 2024