2015-07-17 11:45:43 +00:00
|
|
|
package org.keycloak.authentication;
|
|
|
|
|
|
|
|
import org.jboss.resteasy.spi.HttpRequest;
|
|
|
|
import org.keycloak.ClientConnection;
|
|
|
|
import org.keycloak.events.EventBuilder;
|
|
|
|
import org.keycloak.models.ClientSessionModel;
|
|
|
|
import org.keycloak.models.KeycloakSession;
|
|
|
|
import org.keycloak.models.RealmModel;
|
|
|
|
import org.keycloak.models.UserModel;
|
|
|
|
import org.keycloak.models.UserSessionModel;
|
|
|
|
|
2015-08-11 17:04:40 +00:00
|
|
|
import javax.ws.rs.core.Response;
|
2015-07-17 11:45:43 +00:00
|
|
|
import javax.ws.rs.core.UriInfo;
|
|
|
|
|
|
|
|
/**
|
2015-08-09 19:06:24 +00:00
|
|
|
* Interface that encapsulates current information about the current requred action
|
|
|
|
*
|
2015-07-17 11:45:43 +00:00
|
|
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
|
|
|
* @version $Revision: 1 $
|
|
|
|
*/
|
|
|
|
public interface RequiredActionContext {
|
2015-08-11 17:04:40 +00:00
|
|
|
void ignore();
|
|
|
|
|
|
|
|
public static enum Status {
|
|
|
|
CHALLENGE,
|
|
|
|
SUCCESS,
|
|
|
|
IGNORE,
|
|
|
|
FAILURE
|
|
|
|
}
|
|
|
|
|
2015-08-09 19:06:24 +00:00
|
|
|
/**
|
|
|
|
* Current event builder being used
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
2015-07-17 11:45:43 +00:00
|
|
|
EventBuilder getEvent();
|
2015-08-09 19:06:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Current user
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
2015-07-17 11:45:43 +00:00
|
|
|
UserModel getUser();
|
|
|
|
RealmModel getRealm();
|
|
|
|
ClientSessionModel getClientSession();
|
|
|
|
UserSessionModel getUserSession();
|
|
|
|
ClientConnection getConnection();
|
|
|
|
UriInfo getUriInfo();
|
|
|
|
KeycloakSession getSession();
|
|
|
|
HttpRequest getHttpRequest();
|
2015-08-09 19:06:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Generates access code and updates clientsession timestamp
|
|
|
|
* Access codes must be included in form action callbacks as a query parameter.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
2015-07-17 11:45:43 +00:00
|
|
|
String generateAccessCode(String action);
|
2015-08-11 17:04:40 +00:00
|
|
|
|
|
|
|
Status getStatus();
|
|
|
|
|
|
|
|
void challenge(Response response);
|
|
|
|
void failure();
|
|
|
|
void success();
|
2015-07-17 11:45:43 +00:00
|
|
|
}
|