use of org.owasp.esapi.crypto.CryptoToken in project Asqatasun by Asqatasun.
the class TokenManager method getTokenUser.
/**
*
* @param userAccountName
* @param additionalParameters
* @return
*/
public String getTokenUser(String userAccountName, Map<String, String> additionalParameters) {
try {
CryptoToken cryptoToken = new CryptoToken();
cryptoToken.setUserAccountName(userAccountName);
cryptoToken.setExpiration(tokenDurationValidity);
cryptoToken.addAttributes(additionalParameters);
String token = cryptoToken.getToken();
tokenUsage.put(token, Boolean.FALSE);
return token;
} catch (EncryptionException ex) {
Logger.getLogger(this.getClass()).warn(ex);
return "";
} catch (ValidationException ex) {
Logger.getLogger(this.getClass()).warn(ex);
return "";
}
}
use of org.owasp.esapi.crypto.CryptoToken in project Asqatasun by Asqatasun.
the class TokenManager method getTokenUser.
/**
*
* @param userAccountName
* @return
*/
public String getTokenUser(String userAccountName) {
try {
CryptoToken cryptoToken = new CryptoToken();
cryptoToken.setUserAccountName(userAccountName);
cryptoToken.setExpiration(tokenDurationValidity);
String token = cryptoToken.getToken();
tokenUsage.put(token, Boolean.FALSE);
return token;
} catch (EncryptionException ex) {
Logger.getLogger(this.getClass()).warn(ex);
return "";
} catch (ValidationException ex) {
Logger.getLogger(this.getClass()).warn(ex);
return "";
}
}
use of org.owasp.esapi.crypto.CryptoToken in project Asqatasun by Asqatasun.
the class TokenManager method getTokenUser.
/**
* @param userAccountName
* @param additionalParameters
* @return
*/
public String getTokenUser(String userAccountName, Map<String, String> additionalParameters) {
try {
CryptoToken cryptoToken = new CryptoToken();
cryptoToken.setUserAccountName(userAccountName);
cryptoToken.setExpiration(tokenDurationValidity);
cryptoToken.addAttributes(additionalParameters);
String token = cryptoToken.getToken();
tokenUsage.put(token, Boolean.FALSE);
return token;
} catch (EncryptionException | ValidationException ex) {
LOGGER.warn(ex.getMessage());
return "";
}
}
Aggregations