Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support per-instance authentication using Authorization: Bearer $TOKEN method #16

Open
tensiondriven opened this issue Feb 20, 2014 · 0 comments

Comments

@tensiondriven
Copy link

I have been trying to adapt this gem to support the Authorization: Bearer $TOKEN method for authenticating using a token retrieved from OAuth.

I was able to hack in the header, but since the gem uses a singleton, every call to Asana::Anything will use the same credentials. In a common use case, this means one user's credentials can be set, and then another user in another session can use those credentials.

This seems a little backwards... IMHO the gem should /only/ support per-session authentication, since that's the most common use case.

To do this, we'd instantiate a new Asana object and pass it a $TOKEN or $API_KEY, that object would then use the supplied credentials for the life of the object. Calling Asana:: module directly shouldn't be allowed.

You can take a look at my modifications here: http://github.com/tronathan/asana - I'm happy to do the work to make this work as an instance object, but I need some pointers. Not sure how to make ActiveResource work that way.

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

No branches or pull requests

1 participant