Securing OAuth Secrets
A secure password storage strategy is critical to mitigating data breaches. This article provides an overview and practical details on securing OAuth Secrets in the Ed-Fi ODS / API.
Overview
Hashing is the foundation of secure password storage. It guards against the possibility that someone who gains unauthorized access to the database can retrieve the password for every client in the system.
Hashing performs a one-way transformation on a password, turning the password into a string called the hashed password. "One-way" simply means that it is practically impossible to derive the original password once it has been transformed into the hashed password. There are several mathematically complex hashing algorithms that work for this purpose.
By default, the Ed-Fi ODS / API stores OAuth secrets securely using PBKDF2-HMACSHA1 algorithm in deployment environments. For ease of use, the development environment does not use hashing by default.
The hash implementation in the Ed-Fi ODS / API is resilient to hash algorithm
changes in future and allows for customization if implementations require a
different hashing algorithm. The OAuth secret database (EdFi_Admin) stores the
hashing details used when the hash was generated so those settings can be used
to regenerate the password hash from plain text while transitioning to a new
provider. The general flow for updates is that an OAuth secret is presented to
the application and the secret is verified using the hash method indicated in
the database. If valid, the original OAuth secret that was presented is
re-hashed using the new algorithm and the hashing method details are updated.