Skip to content

token salting/hashing in DB, docs, changes #16

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

Open
secynic opened this issue Mar 10, 2017 · 4 comments
Open

token salting/hashing in DB, docs, changes #16

secynic opened this issue Mar 10, 2017 · 4 comments

Comments

@secynic
Copy link
Contributor

secynic commented Mar 10, 2017

I want to thank you for this library, it has saved me quite some time.

I would like to work on some changes:

  • hash/salt of client secret, access_token and refresh_token in the DB - the actual secret/tokens should be provided once at generation time, and then regenerated if forgotten (will have new requirement - cryptacular.bcrypt)
  • Sphinx configuration and more docs (need to setup readthedocs and add/fix docstrings)
  • Changes file

Let me know if you are open to this.

P.S. I confirmed the PRs from @tonthon are working.

@elliotpeele
Copy link
Owner

elliotpeele commented Mar 10, 2017 via email

secynic added a commit to secynic/pyramid_oauth2_provider that referenced this issue Mar 10, 2017
@secynic
Copy link
Contributor Author

secynic commented Mar 11, 2017

^ This should be good aside from Sphinx/docs

Only minor issue is cryptacular and bcrypt libraries in general require a C compiler. Those instructions can be added into the readme easily, and in my opinion, outweigh not having any security on the DB secrets.
-EDIT Going to try scrypt (cryptography) instead so there are no build issues.

I could not add that security to the access_token and refresh_token due to how Bearer works. I think it would be good to later add AES 256 encryption (PyCrypto + hashlib) on those columns, with a random encryption key stored in the config ini. I may write a new helper library for that since I already wrote the code for a private project.

Let me know if you are ok with these changes, and I will submit a PR. I also included #10 as that script was failing otherwise.

@elliotpeele
Copy link
Owner

I'd like to see the changes split out into a few different patches.

  • Formatting fixes
  • epdb removal
  • py3 changes
  • crypto changes

@secynic
Copy link
Contributor Author

secynic commented Mar 13, 2017

I will work on this. You can merge #13.

-EDIT: Some of the Python 2vs3 encoding changes will need to be bundled with the crypto PR. I would rather bundle all of them so tests pass. I can still split out the formatting fixes, deprecations, and other fixes. master...secynic:ref16 is almost ready to be split up.

secynic added a commit to secynic/pyramid_oauth2_provider that referenced this issue Mar 14, 2017
…secret column changed to binary, py2v3 encoding fixes
secynic added a commit to secynic/pyramid_oauth2_provider that referenced this issue Mar 14, 2017
secynic added a commit to secynic/pyramid_oauth2_provider that referenced this issue Mar 14, 2017
secynic added a commit to secynic/pyramid_oauth2_provider that referenced this issue Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants