-
Type:
Bug
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.7.7
-
Fix Version/s: 3.0.0-milestone1, 2.7.8
-
Component/s: JAX-RS Security
-
Labels:None
-
Estimated Complexity:Unknown
AbstractGrant.toMap method has this line:
map.putSingle(OAuthConstants.GRANT_TYPE, OAuthConstants.CLIENT_CREDENTIALS_GRANT);
When the subclass, ResourceOwnerGrant overides this toMap, it calls the super.toMap(), which will cause this wrong value being added.
So, I think we should fix this by calling map.putSingle(OAuthConstants.GRANT_TYPE, getType()).
This way it will work for all 4 subclasses and will automatically work for future new class. Another way is to fix the ResourceOwnerGrant by not calling super.toMap.