New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reader module for Strategies configurations #51
Comments
@yordis sorry, I'm not following the use-case you've outlined. Could you expand on it? |
@scrogson Right now we have to put, for example The idea is that you could have different ways to load the configuration for the strategies. I could use This allow us to even have multiple configurations for the strategies if we want to actually base the configuration |
When we're talking about credentials, are we talking about ueberauth or particular strategies? The solution will likely be different |
@hassox the idea is to be able to configure the strategies from the database. For example: Facebook strategy, needs Of course, we need to agree in some interface for the module, but that's the idea |
Is there any progress on this? If not, I might work on this, as we need this in the near future. |
@arjan do you have any thing in mind on how to start with this? @scrogson and I talked about it but we didn't settle on anything. There is some thoughts around this like: Configuration based on some parameter: this parameter could come from some HTTP request or you calling directly the Ueberauth workflow with some key I am guessing. We need to think about it. |
So, basically we would like all configuration related to a strategy to be dynamically retrieved, right? Maybe we can create a config setting:
Which specifies a MFA tuple for the reader function. The strategy reader would be called every time a strategy configuration needs to be retrieved (using The default implementation would be something like:
Where Based on the |
@arjan yes and no, That could be a possibility but we are trying to move away from Also, related to that, I would pass some parameter that helps the reader to know which strategy is because. What if you have multiple strategies fro Facebook? How do you know which one you refer to if you don't pass an extra information? |
Agreed. Did not know about the moving away from Plug part (I saw it listed in the dependencies that's why Absinthe itself uses the pdict also quite heavily btw ;-) Alternatively we can create some initialization function which you need to call on each request before the ueberauth magic happens. It returns some |
Also keep in mind that (based on e.g. request information) one request would only be allowed to use a Facebook strategy while another one could use microsoft and fitbit. I don't know if that kind of flexibility is planned to be built in (or at least planned to be achievable through extension; it has been suggested though within #61) but it would be pretty great to have it for multi-tenant scenarios. |
@rmoorman the first step IMHO is to remove the dependency with Multi-tenant at that moment becomes easier because for the Core still the same but you can create your own Controller/Plug/Middleware that knows how to read the configuration either by using URLs or Headers or whatever decision you made. But I think that we should tackle the Thinking out loud |
Makes sense @yordis , thank you! |
Okay, so I hear it's not time for me to start on this, I guess :-) Is there already an issue for the Plug.Conn rewrite that I could track? |
Moved to #90 |
Add the ability to change the way we read the configuration of the strategies. Right now we have to reload or coding the configuration (See https://github.com/ueberauth/ueberauth/blob/master/lib/ueberauth.ex#L175)
Use Case
Services like
Firebase
orAuth0
allow you to configure thesocial media
integration on their platform. They save the configuration in the database which allow us to easy change the configuration.Examples:
Thought
We could add a configuration, like
That allow use to load the configuration of the
provider
. This module could be usingEcto
or whatever we want to load that configuration.The
Reader module
should follow aprotocol
in how to send the data back for sure (I need your help in how to think a little bit deeper on this)cc: @doomspork
The text was updated successfully, but these errors were encountered: