Closed klauern closed 7 years ago
@klauern, API provides certain endpoints which have to be accessed with a authenticated user (eg- like a photo, add a photo) so it is necessary to use the staticsource method for automated testing.
I'm not sure if I'm making sense.
That's fine, but you authenticate with the clientcredentials.Config
, right? At least, the way I'm testing it, I'm getting mostly working with this, and my application configuration has this set.
Is this not workable? I'm no OAuth expert, so you're quite possibly right. That said, I had some issues using the StaticToken....
that you had, and I found this work instead, at least from a client-testing perspective.
clientcredentials.Config can be used and it'll most probably work with endpoints which don't need user authentication but will fail otherwise.
Do the following-
$ cat "unsplash_usertoken=<YOUR-AUTH-TOKEN>" > auth.env
If you don't have an auth token you can generate one with some work. I can help you with that. Let me know.t
The method you propose is the way to go but here we have constraints for test automation.
Hello. I teased out the commit to another branch, and then created another pull request. Let me know if that works for you.
Closing this for now, reopen if we need further discussion.
As per the documentation, 2-legged OAuth2 is preferred if you're not running as a third party. As this is a provided feature, it's simpler to set up and requires one less parameter.