Skip to content

Salesforce doesn't like receiving a scope= query param on the token endpoint #165

@ohler

Description

@ohler

The example in https://godoc.org/golang.org/x/oauth2#ex-Config doesn't work with Salesforce; to make it work, we have to set conf.Scopes = nil before the call to conf.Exchange().

See also https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_web_server_flow.htm&language=en , where "scope" is a documented query param for the authorization endpoint but not the token endpoint. That page doesn't explicitly say that passing "scope" is an error, but testing shows that the server responds with 400 {"error":"invalid_request","error_description":"scope parameter not supported"}.

Having the conf.Scopes = nil workaround in our code doesn't bother me much (it's hardly the only API quirk that requires workarounds in our code), but your philosophy in #111 makes me think you'd like to know about this and move the workaround to this package instead (or at least clarify the example).

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