pow-auth / assent

Multi-provider framework in Elixir
https://powauth.com
MIT License
391 stars 45 forks source link

Allow to pass `state` parameter #119

Closed yordis closed 1 year ago

yordis commented 1 year ago

Hey there,

We would like to pass the state parameter: https://github.com/pow-auth/assent/blob/61cf499c938283ee5d94766b40185588411b653a/lib/assent/strategies/oauth2.ex#L101

We want to marshal some JSON payload as base64 to pass a state from the client into the oauth2 flow.

Would you be willing to add the feature?

danschultzer commented 1 year ago

Hi @yordis! You should be able to do that using the :authorization_params config:

config
|> Keyword.put(:authorization_params, state: encoded_payload)
|> Assent.Startegy.OAuth2.authorize_url()