You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by GitBox <gi...@apache.org> on 2019/05/30 13:19:01 UTC

[GitHub] [shiro] bdemers commented on a change in pull request #138: Support base64 encoded salt in JdbcRealm

bdemers commented on a change in pull request #138: Support base64 encoded salt in JdbcRealm
URL: https://github.com/apache/shiro/pull/138#discussion_r288985987
 
 

 ##########
 File path: core/src/main/java/org/apache/shiro/realm/jdbc/JdbcRealm.java
 ##########
 @@ -247,7 +261,11 @@ protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
             info = new SimpleAuthenticationInfo(username, password.toCharArray(), getName());
             
             if (salt != null) {
-                info.setCredentialsSalt(ByteSource.Util.bytes(salt));
+            	if (saltStyle == SaltStyle.COLUMN && saltIsBase64Encoded) {
+                    info.setCredentialsSalt(ByteSource.Util.bytes(Base64.decode(salt)));
 
 Review comment:
   We could probably decode this once in `setSaltIsBase64Encoded()` and reduce the branch here

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services