-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Finalize strategy / documentation for storing Twitter Consumer Secret #269
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
Comments
I've thought a bit more about this. The most correct way to handle the secret is for the user to set up a server and request the consumer secret from there. In my opinion, this is too much to ask of our users given that this library is intended to be a one-stop solution for authentication. I think we should stick with the current implementation or if we're really worried about it we should remove the Twitter IDP from all platforms. Thoughts? |
What's the worst someone can do to you if they get this secret? And does On Thu, Oct 6, 2016 at 10:01 AM Aaron Mandle [email protected]
|
I did ~15mins of web searching and it seems that Twitter is basically saying "you shouldn't hardcode it in your app, but here's a tutorial showing how to hardcode it in your app". I am inclined to just keep things as-is with a big ol' warning above it saying exactly what the risks are. If there is demand, in |
I'm wary of baking this into FirebaseUI since we do consider it our best practices, but since it seems to be the best way to make it feasible for developers to use Twitter and Twitter tutorials itself seem to use it, I think we can move forward as noted. Definitely agree with sam's point that we should keep it, but make explicit what the risks are and look into changes for v1.1 based on developer demand. |
Any suggestions for what the warning text should say? Maybe something like
|
Wouldn't saving the key in the real time database work? We could put in the documentation that you have to add an entry such as |
@amandle @samtstern So is there no way to store the Twitter secret in the real-time database now? |
@SUPERCILEX we would like to have FirebaseUI-Auth not have dependencies on the db if possible |
K, thanks! |
Hi understand this issue was closed and your decision made (and I agree with it for the sake of being a simple plug-and-play solution), but I'm not keen on storing the credentials in such plain sight - For those of us that already store and fetch these credentials remotely, would an option to add them in during the IdpConfig building process be a solution:
If the keys and ids etc are found to be null, you would then check for them in the String resources, as per now? |
@brandall76 the problem as I see it is that we need the Twitter secret at build time to get into the Android Manifest:
Do you know of some alternative to this? If so I agree, adding a builder method for the API key would be ideal. |
Thanks for your response @samtstern From what I can establish the Manifest Meta-Data tag isn't actually needed for the Twitter authorisation process to function correctly. The tag is only required to supply the Fabric API Key, for use with other aspects of their SDK, such as Crashlytics. However, if you remove the tag, the process will crash with:
To work around this issue, you can simply change the Manifest tag to the following:
This will suppress the error, purely due to a value (any value) being present when checked by the ApiKey class. To test any further possible dependency, I removed the Twitter Strings and replaced the references to the them in the TwitterProvider constructor, with hard-coded values. Everything works fine. To resolve the need for a random String at all, Fabric would need to alter the thrown exception to a warning (logErrorOrWarn). Now they are owned by Google, I assume this is easier for you to ask! 😃 Let me know your thoughts - if you consider the placeholder string a viable release work-around, I'll knock up some code. Ben |
@brandall76 thanks for investigating! Given that the Fabric is part of Google now, I will ask them if there are any consequences of putting a 'random' string in the |
Hey Team, |
Thanks @samtstern - while you're at it, any thoughts on decoupling the Twitter authorisation from Fabric entirely? It would remove a 'dependency'. @ashwinraghav appreciate what you're saying, nothing is sacred... But, I would at least like to make it as hard as possible, if only for the sake of good practice. For this particular issue, the current skill level required to access the secret, is the ability to unzip an APK file.... |
#268 introduces Twitter as an IDP and has the consumer secret as a resource. We should evaluate the risks of this, find out what industry best practice is, and document our decision along with the tradeoffs.
The text was updated successfully, but these errors were encountered: