Skip to content

Conversation

@fredbradley
Copy link

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

Here was the solution.

@Sammyjo20
Copy link
Member

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 Sammyjo20 changed the title add OAuth1Authenticator and test Feature | Add OAuth 1.0a Authenticator Dec 2, 2024
@Sammyjo20
Copy link
Member

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

@fredbradley
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants