List of usage examples for org.apache.shiro.authc SimpleAuthenticationInfo getCredentialsSalt
public ByteSource getCredentialsSalt()
From source file:com.ning.billing.server.security.KillbillJdbcRealm.java
License:Apache License
@Override protected AuthenticationInfo doGetAuthenticationInfo(final AuthenticationToken token) throws AuthenticationException { final SimpleAuthenticationInfo authenticationInfo = (SimpleAuthenticationInfo) super.doGetAuthenticationInfo( token);// w w w. j a va 2s .c o m // We store the salt bytes in Base64 (because the JdbcRealm retrieves it as a String) final ByteSource base64Salt = authenticationInfo.getCredentialsSalt(); authenticationInfo.setCredentialsSalt(ByteSource.Util.bytes(Base64.decode(base64Salt.getBytes()))); return authenticationInfo; }
From source file:me.buom.shiro.realm.jdbc.HmacJdbcRealm.java
License:Apache License
protected void beforeAssertCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) { SimpleAuthenticationInfo authInfo = (SimpleAuthenticationInfo) info; Object oldCredentials = authInfo.getCredentials(); Object stringToSign = hmacBuilder.buildStringToSign((HmacToken) token); authInfo.setCredentials(stringToSign); if (log.isDebugEnabled()) { log.debug("oldCredentials: {}", oldCredentials); log.debug("credentials: {}", authInfo.getCredentials()); log.debug("credentialsSalt: {}", authInfo.getCredentialsSalt().toHex()); }/*from w w w. ja v a 2 s . c o m*/ }
From source file:org.killbill.billing.server.security.KillbillJdbcTenantRealm.java
License:Apache License
@Override protected AuthenticationInfo doGetAuthenticationInfo(final AuthenticationToken token) throws AuthenticationException { final SimpleAuthenticationInfo authenticationInfo = (SimpleAuthenticationInfo) super.doGetAuthenticationInfo( token);//from ww w. j a v a2 s . c o m // We store the salt bytes in Base64 (because the JdbcRealm retrieves it as a String) final ByteSource base64Salt = authenticationInfo.getCredentialsSalt(); final byte[] bytes = Base64.decode(base64Salt.getBytes()); // SimpleByteSource isn't Serializable authenticationInfo.setCredentialsSalt(new SerializableSimpleByteSource(bytes)); return authenticationInfo; }