You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Thomas Iguchi (JIRA)" <ji...@apache.org> on 2018/08/10 01:30:00 UTC
[jira] [Updated] (CXF-7819) Allow OAuth2 refresh tokens to be
hashed and irrecoverable
[ https://issues.apache.org/jira/browse/CXF-7819?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Iguchi updated CXF-7819:
-------------------------------
Description:
I want to store only hashed refresh tokens in my database since they appear to me pretty much like the equivalent of user passwords and I don't feel comfortable storing them in plain text.
I do not plan to delete refresh tokens unless requested by the user ("session termination") or after a long enough time of user inactivity. So in case my refresh token DB should get leaked I hope that the extracted data will be pretty much worthless.
However, the `OAuthDataProvider` interface has the following method:
{code:java}
/**
* Return all refresh tokens associated with a given client
* @param client the client
* @param subject the user subject, can be null
* @return list of refresh tokens
* @throws OAuthServiceException
*/
List<RefreshToken> getRefreshTokens(Client client, UserSubject subject) throws OAuthServiceException;
{code}
It looks to me as if the framework is set up in a way so existing refresh tokens should be retrievable from the data store. This is a bit of a road block to me at the moment. I cannot recover the token string.
I used IntelliJ in order to trace usage of that method throughout my code base including CXF and cannot find a single caller (yet)...
I want to check back with you what the intended purpose behind that method is. Would it harm the (future) functionality of the CXF OAuth2 module if I would let that method return an empty list or just null, or maybe a list with blank token string properties?
Also, what is the idea behind that method? When would a client / user request all refresh tokens?
Thanks in advance!
was:
I want to store refresh tokens salted and hashed in my database since they appear to me pretty much like the equivalent of user passwords and I don't feel comfortable storing them in plain text.
I do not plan to delete refresh tokens unless requested by the user ("session termination") or after a long enough time of user inactivity. So in case my refresh token DB should get leaked I hope that the extracted data will be pretty much worthless.
However, the `OAuthDataProvider` interface has the following method:
{code:java}
/**
* Return all refresh tokens associated with a given client
* @param client the client
* @param subject the user subject, can be null
* @return list of refresh tokens
* @throws OAuthServiceException
*/
List<RefreshToken> getRefreshTokens(Client client, UserSubject subject) throws OAuthServiceException;
{code}
It looks to me as if the framework is set up in a way so existing refresh tokens should be retrievable from the data store. This is a bit of a road block to me at the moment. I cannot recover the token string.
I used IntelliJ in order to trace usage of that method throughout my code base including CXF and cannot find a single caller (yet)...
I want to check back with you what the intended purpose behind that method is. Would it harm the (future) functionality of the CXF OAuth2 module if I would let that method return an empty list or just null, or maybe a list with blank token string properties?
Also, what is the idea behind that method? When would a client / user request all refresh tokens?
Thanks in advance!
> Allow OAuth2 refresh tokens to be hashed and irrecoverable
> -----------------------------------------------------------
>
> Key: CXF-7819
> URL: https://issues.apache.org/jira/browse/CXF-7819
> Project: CXF
> Issue Type: Wish
> Components: JAX-RS Security
> Affects Versions: 3.2.5
> Reporter: Thomas Iguchi
> Priority: Minor
>
>
> I want to store only hashed refresh tokens in my database since they appear to me pretty much like the equivalent of user passwords and I don't feel comfortable storing them in plain text.
> I do not plan to delete refresh tokens unless requested by the user ("session termination") or after a long enough time of user inactivity. So in case my refresh token DB should get leaked I hope that the extracted data will be pretty much worthless.
>
> However, the `OAuthDataProvider` interface has the following method:
>
> {code:java}
> /**
> * Return all refresh tokens associated with a given client
> * @param client the client
> * @param subject the user subject, can be null
> * @return list of refresh tokens
> * @throws OAuthServiceException
> */
> List<RefreshToken> getRefreshTokens(Client client, UserSubject subject) throws OAuthServiceException;
> {code}
>
> It looks to me as if the framework is set up in a way so existing refresh tokens should be retrievable from the data store. This is a bit of a road block to me at the moment. I cannot recover the token string.
> I used IntelliJ in order to trace usage of that method throughout my code base including CXF and cannot find a single caller (yet)...
> I want to check back with you what the intended purpose behind that method is. Would it harm the (future) functionality of the CXF OAuth2 module if I would let that method return an empty list or just null, or maybe a list with blank token string properties?
> Also, what is the idea behind that method? When would a client / user request all refresh tokens?
>
> Thanks in advance!
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)