I have the same problem. So far, I can’t find a safe way.
Basically, we need an arbitrarily created secret for each site, provided only with an implicit stream, which can be used to obtain credentials for accessing systems and decrypting data.
Since I want to protect the data from myself, I could write to the client to salt / hash the secret in two ways, one way to get the data, and the other to decrypt it.
Alas, this is not so.
I could get credentials from things in the main oAuth area and this will protect the data from me, but it will open up great opportunities for cross-site vulnerabilities, and in addition, personal identification information makes a bad secret.
The best I got was to use the implicit oAuth2 stream to get the user's email address, randomly generate the client’s secret part and force the user to send a secret via email (as a recovery key), and then store the secret in localStorage. Salt / Hash of the secret variable + oauth to obtain the client part of the credentials (so that the user should be logged in), necessary for access, encryption and decryption of the data.
If a user ever cleans up his local storage, he needs to follow the link in the recovery email, which puts the secret in localStorage.
This puts the vulnerability back to the client, but is resistant to public machines (you had to know who was last registered and get access to the localStorage token), allows for recovery and weakly requires the user to log in. Still vulnerable to plugin attacks and physical access + knowing the user.
Update . I decided to use some oAuth extensions (hello.js, folder APIs) to store keys in the user account as files. It requires some permissions and some APIs to implement, but seems viable.