Currently, Flask-OAuth supported only a single token per OAuth instance. This means that you can, for example, sign up with your Twitter account, and send tweets from that account, but if you sign up with multiple Twitter accounts, you are unable to send tweets from an arbitrary one of them (at least not without residing to evil solutions like keeping global state with the "default" OAuth token to use). What this patch adds: * Each of OAuth's request methods (get, post, put, delete, and request) gets an optional `token` argument, which can be passed in to send the request using that token. * The token will be passed to the `tokengetter_func`. The tokengetter function thus can be prepared to receive a `token` argument. For example: @twitter.tokengetter def my_token_getter(token=None): if token is not None: # During auth, token won't be passed oauth_secret = get_my_secret_for_token(token) return (token, oauth_secret) return None * For backwards-compatibility, the `token` argument will only be passed to the `tokengetter_func` when it is explicitly passed as a kwarg to one of the request methods.
…thod for token authorizations.
…, needed to support Google's implementation which requires a non-standard 'scope' parameter Signed-off-by: Armin Ronacher <firstname.lastname@example.org>