For my application i want to implement HTTP basic authentication in combination with symmetric encryption. The base64 encoded username and password get encrypted with an encryption key when sent, and decrypted with the same key when recieved by the REST api.
So far i managed to implement HTTP basic authentication. I am not sure how i can add the extra layer of encryption.
I do have some kind of idea how i can make this work. What i've got so far is:
- Before authentication gets invoked by spring, retrieve the encrypted string from the headers.
- Decrypt the string using the encryption key
- Save the decrypted information in the headers
- Invoke authentication with the new headers (now containing base64 encoded username + password)
Am i on the right track, and if so, how do i go about implementing this in Spring?