You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm implementing a provider, which needs an aditional body parameter when calling the token endpoint.
in order to override &Assent.Strategy.callback/2, i think that the additional defoverridable Helpers (or defoverridable callback: 2) is needed, otherwhise the implementation in my custom module is ignored.
** Should this overridable definition not be included in the __using/2 definition of Assent.Strategy.OAuth2.Base?
In order to override the callback/2 in my implementation module i need to do this:
defmoduleCanteAuth.Assent.Strategy.AnafdouseAssent.Strategy.OAuth2.Base#Shouldn't this be in Assent.Strategy.OAuth2.Base.__using__/1?defoverridableHelpers...@implHelpersdefcallback(config,params)do
Is the macro Assent.Strategy.OAuth2.Base.__using__/1 really missing the line
defoverridableHelpers
or am I missing something obvious, for overriding functions imported from Assent.Strategy?
Thank you for this wonderful library! ❤️
The text was updated successfully, but these errors were encountered:
There's no need to as you can just implement a strategy that calls Assent.Strategy.OAuth2 directly:
defmoduleCanteAuth.Assent.Strategy.Anafdo@behaviourAssent.StrategyaliasAssent.Strategy.OAuth2@implAssent.Strategydefauthorize_url(config)doOAuth2.authorize_url(config(config))enddefpconfig(config)do# Set defaults here and merge with the configend@implAssent.Strategydefcallback(config,params)doOAuth2.callback(config(config),params)enddeffetch_user(config,token),do: OAuth2.fetch_user(config,token)end
This is essentially for use Assent.Strategy.OAuth2.Base does. We may want to allow setting something similar to the authorization_params for authorize_url/2, e.g. grant_access_token_params.
I'm implementing a provider, which needs an aditional body parameter when calling the
token
endpoint.in order to override
&Assent.Strategy.callback/2
, i think that the additionaldefoverridable Helpers
(ordefoverridable callback: 2
) is needed, otherwhise the implementation in my custom module is ignored.** Should this overridable definition not be included in the
__using/2
definition ofAssent.Strategy.OAuth2.Base
?The use definition defines these behavoiurs:
assent/lib/assent/strategies/oauth2/base.ex
Lines 44 to 45 in 4457d3e
The only defoverridable in the
Assent.Strategy.OAuth2.Base.__using__/1
Macro is this one:assent/lib/assent/strategies/oauth2/base.ex
Line 58 in 4457d3e
In order to override the
callback/2
in my implementation module i need to do this:Is the macro
Assent.Strategy.OAuth2.Base.__using__/1
really missing the lineor am I missing something obvious, for overriding functions imported from
Assent.Strategy
?Thank you for this wonderful library! ❤️
The text was updated successfully, but these errors were encountered: