Skip to content

Oauth2: Support for providing scopes during Refresh token flow. #234

Closed
@bwplotka

Description

@bwplotka

Hi, It is often required to provide scopes for refresh token flow. However I cannot pass any additional url.Values for TokenSource.Token https://github.com/golang/oauth2/blob/master/oauth2.go#L232

Is there any reason why oauth2.Token() method does not allow to provide that optional parameter? See: https://tools.ietf.org/html/rfc6749#section-6

What do you think about such change?

tk, err := retrieveToken(tf.ctx, tf.conf, url.Values{
                "grant_type":    {"refresh_token"},
                "refresh_token": {tf.refreshToken},
+++             "scope":      internal.CondVal(strings.Join(tf.conf.Scopes, " ")),
})

How can I workaround that if the above change is not possible?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions