intridea/omniauth-oauth2 — pull request #19 by jash (2012-07-09 16:49:00+00:00)
Title: Add auth_token_params as an option when getting a token

I've run into a problem where I need to pass some extra options when generating a token. The oauth2 gem (which defines AccessToken) allows an extra options parameter which can be used to customize such things as (:refresh_token, :expires_at, :expires_in, :mode, :header_format, and :param_name).

Unfortunately, the way the code is now for this oauth2 strategy, there appears to be no way to provide these extra parameters. This patch allows an extra configuration option to be defined in a strategy class, for example:

```ruby
option :auth_token_params, { :header_format => 'OAuth %s' }
```

This option is passed to client.auth_code.get_token() as a third parameter, which eventually gets included when the AccessToken is created.

--John