sahat/satellizer

Custom parameters in `*UrlParams`

vnwhlr opened this issue · 0 comments

Hello,

I have a use case for supplying non-standard query parameters to the authorization endpoint when calling authenticate(). In this case, it's supplying the team parameter when authorizing with Slack. We want users to associate their identity using a team ID that exists in our system, which is not a static value - it varies by user.

Looking at https://github.com/sahat/satellizer/blob/master/src/oauth2.ts#L132, though, it looks like this isn't possible, because in https://github.com/sahat/satellizer/blob/master/src/oauth2.ts#L139, either paramValue is a static value or the result of evaluating a function defined in the OAuth configuration, but there's nowhere in the authenticate signature where we can supply information accessible by that function.

Is there a workaround? Can I override the authorizationEndpoint or create a team function in the configuration to do something clever when building the query parameters? If there's no workaround, is this something that will eventually be supported? Slack can't be the only service that can take non-standard parameters in its OAuth flow (#396).

Thanks!