How to fake requests with OAuth2? #334
Replies: 1 comment
-
Hey @thursdaydan thank you for the kind words! ❤️ I wonder if this is because the Let me know if there's something wrong with the cast with null values and I can take a look. You can "fake" the OAuth2 process just like you are with the current mock client - you can fake the underlying OAuth2 requests: Listed here: https://github.com/saloonphp/saloon/tree/v3/src/Http/OAuth2 Although faking OAuth2 can be tricky because in a test suite, there's no browser to open to initiate the OAuth2 process. It's been something I've been thinking about for a while. Let me know if you have any ideas on this. |
Beta Was this translation helpful? Give feedback.
-
Hi, just started using saloon and loving it. It's an excellent package and we are building all of our API integrations with it for a nice standardised developer experience.
I'm just starting to explore the testing side of it and have a question around OAuth2, I've not seen any discussion of this in here or the docs and wondered if someone could tell me where I'm going wrong please.
This is my basic test at the moment:
Running the above results in the following error:
Here is how I'm handling the authentication, based from the spotify example repo:
Beta Was this translation helpful? Give feedback.
All reactions