~nataliabidart/canonical-identity-provider/admin-access-via-sso

Viewing all changes in revision 1351.

[r=ricardokirkner,james-w] Store only AuthToken hashes in the database.

Since AuthTokens are security-sensitive, once a raw token is generated and sent to the user via either e-mail or URL redirection, the raw value is discarded and only a hash is kept in the database. So raw tokens can't be recovered directly from the database.

The data is stored in the same existing "token" column (though renamed at model-level to "hashed_token").

The code accounts for "old-style", raw tokens to be stored in the same table; all existing tokens continue to be valid and can be used. However, only "new-style", hashed tokens will be stored in the future.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: