All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.castle.client.model.AuthenticateAction Maven / Gradle / Ivy

Go to download

Castle adds real-time monitoring of your authentication stack, instantly notifying you and your users on potential account hijacks.

There is a newer version: 2.4.2
Show newest version
package io.castle.client.model;

/**
 * Action that needs to be taken after a login attempt.
 * 

* See the documentation for the semantics of each case. * It can be null. * * @see Adaptive authentication */ public enum AuthenticateAction { ALLOW, DENY, CHALLENGE; /** * Returns an AuthenticateAction from a string representing its name. * * @param action string representing the name of the AuthenticateAction, case-insensitive * @return the enum value matching the name, or null if it does not match any enum */ public static AuthenticateAction fromAction(String action) { if (action == null) { return null; } try { return AuthenticateAction.valueOf(action); } catch (IllegalArgumentException e) { // no op, use string compare functions. } if (action.compareToIgnoreCase(ALLOW.name()) == 0) { return ALLOW; } if (action.compareToIgnoreCase(DENY.name()) == 0) { return DENY; } if (action.compareToIgnoreCase(CHALLENGE.name()) == 0) { return CHALLENGE; } return null; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy