saloon icon indicating copy to clipboard operation
saloon copied to clipboard

Feature | Add OAuth 1.0a Authenticator

Open fredbradley opened this issue 1 year ago • 3 comments

I was working on a project that needed authentication with OAuth1.0a.

Here was the solution.

fredbradley avatar Nov 29 '24 16:11 fredbradley

Thanks @fredbradley I will take a look soon and see if I can potentially refactor this to be trait-style like the other OAuth2 implementations, unless you want to give it a go?

Sammyjo20 avatar Dec 02 '24 23:12 Sammyjo20

Hey @fredbradley any further thoughts on moving to a trait?

Sammyjo20 avatar May 02 '25 16:05 Sammyjo20

Hi @Sammyjo20,

I wasn't sure there was need to make it into a trait. It's a one class Authenticator, just like the other Authenticators.

Usage:

protected function defaultAuth(): ?Authenticator
    {
        return new OAuth1Authenticator(
            consumerKey: config('services.xx.access_token'),
            consumerSecret: config('services.xx.secret'),
            token: config('services.xx.access_token'),
            tokenSecret: config('services.xx.token_secret')
        );
    }

I don't see the benefit of converting it to be trait like, this syntax is used elsewhere in Saloon. In Http\Auth

fredbradley avatar May 05 '25 19:05 fredbradley