Class AuthenticationManagementResource
java.lang.Object
org.keycloak.services.resources.admin.AuthenticationManagementResource
- Author:
- Bill Burke
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAuthenticationManagementResource
(KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
Add new authentication executionjakarta.ws.rs.core.Response
addExecutionFlow
(String flowAlias, Map<String, Object> data) Add new flow with new execution to existing flowjakarta.ws.rs.core.Response
addExecutionToFlow
(String flowAlias, Map<String, Object> data) Add new authentication execution to a flowbuildProviderMetadata
(Stream<ProviderFactory> factories) jakarta.ws.rs.core.Response
Copy existing authentication flow under a new name The new name is given as 'newName' attribute of the passed JSON objectstatic void
copy
(KeycloakSession session, RealmModel realm, String newName, AuthenticationFlowModel from, AuthenticationFlowModel to) static AuthenticationFlowModel
copyFlow
(KeycloakSession session, RealmModel realm, AuthenticationFlowModel flow, String newName) jakarta.ws.rs.core.Response
Deprecated.jakarta.ws.rs.core.Response
Create a new authentication flowvoid
deleteFlow
(String id) Delete an authentication flowGet authenticator configurationgetAuthenticatorConfig
(String execution, String id) Deprecated.Use rathergetAuthenticatorConfig(String)
getAuthenticatorConfigDescription
(String providerId) Get authenticator provider's configuration descriptionGet authenticator providers Returns a stream of authenticator providers.Get client authenticator providers Returns a stream of client authenticator providers.getExecution
(String executionId) Get Single ExecutiongetExecutions
(String flowAlias) Get authentication executions for a flowGet authentication flow for idgetFlows()
Get authentication flows Returns a stream of authentication flows.Get form action providers Returns a stream of form action providers.Get form providers Returns a stream of form providers.Get configuration descriptions for all clientsgetRequiredAction
(String alias) Get required action for aliasgetRequiredActionConfig
(String alias) Get the configuration of the RequiredAction provider in the current Realm.Get required actions provider's configuration descriptionGet required actions Returns a stream of required actions.Get unregistered required actions Returns a stream of unregistered required actions.void
lowerPriority
(String execution) Lower execution's priorityvoid
Lower required action's priorityjakarta.ws.rs.core.Response
newExecutionConfig
(String execution, AuthenticatorConfigRepresentation json) Update execution with new configurationvoid
raisePriority
(String execution) Raise execution's priorityvoid
Raise required action's priorityvoid
recurseExecutions
(AuthenticationFlowModel flow, List<AuthenticationExecutionInfoRepresentation> result, int level) void
registerRequiredAction
(Map<String, String> data) Register a new required actionsvoid
Delete authenticator configurationvoid
removeExecution
(String execution) Delete executionvoid
removeRequiredAction
(String alias) Delete required actionvoid
removeRequiredActionConfig
(String alias) Remove the configuration from the RequiredAction provider in the current Realm.void
Update authenticator configurationvoid
updateExecutions
(String flowAlias, AuthenticationExecutionInfoRepresentation rep) Update authentication executions of a Flowvoid
updateFlow
(String id, AuthenticationFlowRepresentation flow) Update an authentication flowvoid
Update required actionvoid
Update the configuration of the RequiredAction provider in the current Realm.
-
Field Details
-
logger
protected static final org.jboss.logging.Logger logger
-
-
Constructor Details
-
AuthenticationManagementResource
public AuthenticationManagementResource(KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
-
-
Method Details
-
getFormProviders
@Path("/form-providers") @GET @Produces("application/json") public Stream<Map<String,Object>> getFormProviders()Get form providers Returns a stream of form providers.- Returns:
-
getAuthenticatorProviders
@Path("/authenticator-providers") @GET @Produces("application/json") public Stream<Map<String,Object>> getAuthenticatorProviders()Get authenticator providers Returns a stream of authenticator providers.- Returns:
-
getClientAuthenticatorProviders
@Path("/client-authenticator-providers") @GET @Produces("application/json") public Stream<Map<String,Object>> getClientAuthenticatorProviders()Get client authenticator providers Returns a stream of client authenticator providers.- Returns:
-
buildProviderMetadata
-
getFormActionProviders
@Path("/form-action-providers") @GET @Produces("application/json") public Stream<Map<String,Object>> getFormActionProviders()Get form action providers Returns a stream of form action providers.- Returns:
-
getFlows
@Path("/flows") @GET @Produces("application/json") public Stream<AuthenticationFlowRepresentation> getFlows()Get authentication flows Returns a stream of authentication flows.- Returns:
-
createFlow
@Path("/flows") @POST @Consumes("application/json") public jakarta.ws.rs.core.Response createFlow(AuthenticationFlowRepresentation flow) Create a new authentication flow- Parameters:
flow
- Authentication flow representation- Returns:
-
getFlow
@Path("/flows/{id}") @GET @Produces("application/json") public AuthenticationFlowRepresentation getFlow(@PathParam("id") String id) Get authentication flow for id- Parameters:
id
- Flow id- Returns:
-
updateFlow
@Path("/flows/{id}") @PUT @Consumes("application/json") @Produces("application/json") public void updateFlow(@PathParam("id") String id, AuthenticationFlowRepresentation flow) Update an authentication flow- Parameters:
id
- The flow idflow
- Authentication flow representation
-
deleteFlow
Delete an authentication flow- Parameters:
id
- Flow id
-
copy
@Path("/flows/{flowAlias}/copy") @POST @Consumes("application/json") public jakarta.ws.rs.core.Response copy(@PathParam("flowAlias") String flowAlias, Map<String, String> data) Copy existing authentication flow under a new name The new name is given as 'newName' attribute of the passed JSON object- Parameters:
flowAlias
- Name of the existing authentication flowdata
- JSON containing 'newName' attribute- Returns:
-
copyFlow
public static AuthenticationFlowModel copyFlow(KeycloakSession session, RealmModel realm, AuthenticationFlowModel flow, String newName) -
copy
public static void copy(KeycloakSession session, RealmModel realm, String newName, AuthenticationFlowModel from, AuthenticationFlowModel to) -
addExecutionFlow
@Path("/flows/{flowAlias}/executions/flow") @POST @Consumes("application/json") public jakarta.ws.rs.core.Response addExecutionFlow(@PathParam("flowAlias") String flowAlias, Map<String, Object> data) Add new flow with new execution to existing flow- Parameters:
flowAlias
- Alias of parent authentication flowdata
- New authentication flow / execution JSON data containing 'alias', 'type', 'provider', 'priority', and 'description' attributes- Returns:
-
addExecutionToFlow
@Path("/flows/{flowAlias}/executions/execution") @POST @Consumes("application/json") public jakarta.ws.rs.core.Response addExecutionToFlow(@PathParam("flowAlias") String flowAlias, Map<String, Object> data) Add new authentication execution to a flow- Parameters:
flowAlias
- Alias of parent flowdata
- New execution JSON data containing 'provider' and 'priority' (optional) attribute- Returns:
-
getExecutions
@Path("/flows/{flowAlias}/executions") @GET @Produces("application/json") public List<AuthenticationExecutionInfoRepresentation> getExecutions(@PathParam("flowAlias") String flowAlias) Get authentication executions for a flow- Parameters:
flowAlias
- Flow alias- Returns:
- The list of executions
-
recurseExecutions
public void recurseExecutions(AuthenticationFlowModel flow, List<AuthenticationExecutionInfoRepresentation> result, int level) -
updateExecutions
@Path("/flows/{flowAlias}/executions") @PUT @Produces("application/json") @Consumes("application/json") public void updateExecutions(@PathParam("flowAlias") String flowAlias, AuthenticationExecutionInfoRepresentation rep) Update authentication executions of a Flow- Parameters:
flowAlias
- Flow aliasrep
- AuthenticationExecutionInfoRepresentation
-
getExecution
@Path("/executions/{executionId}") @GET @Produces("application/json") public AuthenticationExecutionRepresentation getExecution(@PathParam("executionId") String executionId) Get Single Execution- Parameters:
executionId
- The execution id- Returns:
-
addExecution
@Path("/executions") @POST @Consumes("application/json") public jakarta.ws.rs.core.Response addExecution(AuthenticationExecutionRepresentation execution) Add new authentication execution- Parameters:
execution
- JSON model describing authentication execution- Returns:
-
getParentFlow
-
raisePriority
@Path("/executions/{executionId}/raise-priority") @POST public void raisePriority(@PathParam("executionId") String execution) Raise execution's priority- Parameters:
execution
- Execution id
-
lowerPriority
@Path("/executions/{executionId}/lower-priority") @POST public void lowerPriority(@PathParam("executionId") String execution) Lower execution's priority- Parameters:
execution
- Execution id
-
removeExecution
@Path("/executions/{executionId}") @DELETE public void removeExecution(@PathParam("executionId") String execution) Delete execution- Parameters:
execution
- Execution id
-
newExecutionConfig
@Path("/executions/{executionId}/config") @POST @Consumes("application/json") public jakarta.ws.rs.core.Response newExecutionConfig(@PathParam("executionId") String execution, AuthenticatorConfigRepresentation json) Update execution with new configuration- Parameters:
execution
- Execution idjson
- JSON with new configuration- Returns:
-
getAuthenticatorConfig
@Path("/executions/{executionId}/config/{id}") @GET @Produces("application/json") @Deprecated public AuthenticatorConfigRepresentation getAuthenticatorConfig(@PathParam("executionId") String execution, @PathParam("id") String id) Deprecated.Use rathergetAuthenticatorConfig(String)
Get execution's configuration- Parameters:
execution
- Execution idid
- Configuration id- Returns:
-
getUnregisteredRequiredActions
@Path("unregistered-required-actions") @GET @Produces("application/json") public Stream<Map<String,String>> getUnregisteredRequiredActions()Get unregistered required actions Returns a stream of unregistered required actions.- Returns:
-
registerRequiredAction
@Path("register-required-action") @POST @Consumes("application/json") public void registerRequiredAction(Map<String, String> data) Register a new required actions- Parameters:
data
- JSON containing 'providerId', and 'name' attributes.
-
getRequiredActions
@Path("required-actions") @GET @Produces("application/json") public Stream<RequiredActionProviderRepresentation> getRequiredActions()Get required actions Returns a stream of required actions.- Returns:
-
toRepresentation
public static RequiredActionProviderRepresentation toRepresentation(RequiredActionProviderModel model) -
getRequiredAction
@Path("required-actions/{alias}") @GET @Produces("application/json") public RequiredActionProviderRepresentation getRequiredAction(@PathParam("alias") String alias) Get required action for alias- Parameters:
alias
- Alias of required action- Returns:
- The required action representation
-
updateRequiredAction
@Path("required-actions/{alias}") @PUT @Consumes("application/json") public void updateRequiredAction(@PathParam("alias") String alias, RequiredActionProviderRepresentation rep) Update required action- Parameters:
alias
- Alias of required actionrep
- JSON describing new state of required action
-
removeRequiredAction
@Path("required-actions/{alias}") @DELETE public void removeRequiredAction(@PathParam("alias") String alias) Delete required action- Parameters:
alias
- Alias of required action
-
raiseRequiredActionPriority
@Path("required-actions/{alias}/raise-priority") @POST public void raiseRequiredActionPriority(@PathParam("alias") String alias) Raise required action's priority- Parameters:
alias
- Alias of required action
-
lowerRequiredActionPriority
@Path("/required-actions/{alias}/lower-priority") @POST public void lowerRequiredActionPriority(@PathParam("alias") String alias) Lower required action's priority- Parameters:
alias
- Alias of required action
-
getRequiredActionConfigDescription
@Path("required-actions/{alias}/config-description") @GET @Produces("application/json") public RequiredActionConfigInfoRepresentation getRequiredActionConfigDescription(@PathParam("alias") String alias) Get required actions provider's configuration description- Parameters:
alias
- The alias of the required action- Returns:
- The required action configuration representation
-
getRequiredActionConfig
@Path("required-actions/{alias}/config") @GET @Produces("application/json") public RequiredActionConfigRepresentation getRequiredActionConfig(@PathParam("alias") String alias) Get the configuration of the RequiredAction provider in the current Realm.- Parameters:
alias
- Provider id- Returns:
- The required action configuration representation
-
removeRequiredActionConfig
@Path("required-actions/{alias}/config") @DELETE public void removeRequiredActionConfig(@PathParam("alias") String alias) Remove the configuration from the RequiredAction provider in the current Realm.- Parameters:
alias
- Provider id
-
updateRequiredActionConfig
@Path("required-actions/{alias}/config") @PUT @Consumes("application/json") public void updateRequiredActionConfig(@PathParam("alias") String alias, RequiredActionConfigRepresentation rep) Update the configuration of the RequiredAction provider in the current Realm.- Parameters:
alias
- provider idrep
- JSON describing new state of RequiredAction configuration
-
getAuthenticatorConfigDescription
@Path("config-description/{providerId}") @GET @Produces("application/json") public AuthenticatorConfigInfoRepresentation getAuthenticatorConfigDescription(@PathParam("providerId") String providerId) Get authenticator provider's configuration description- Parameters:
providerId
- The authenticator provider id- Returns:
- The authenticator configuration representation
-
getPerClientConfigDescription
@Path("per-client-config-description") @GET @Produces("application/json") public Map<String,List<ConfigPropertyRepresentation>> getPerClientConfigDescription()Get configuration descriptions for all clients- Returns:
-
createAuthenticatorConfig
@Path("config") @POST @Consumes("application/json") @Deprecated public jakarta.ws.rs.core.Response createAuthenticatorConfig(AuthenticatorConfigRepresentation rep) Deprecated.Create new authenticator configuration- Parameters:
rep
- JSON describing new authenticator configuration- Returns:
-
getAuthenticatorConfig
@Path("config/{id}") @GET @Produces("application/json") public AuthenticatorConfigRepresentation getAuthenticatorConfig(@PathParam("id") String id) Get authenticator configuration- Parameters:
id
- Configuration id- Returns:
- The authenticator configuration representation
-
removeAuthenticatorConfig
Delete authenticator configuration- Parameters:
id
- Configuration id
-
updateAuthenticatorConfig
@Path("config/{id}") @PUT @Consumes("application/json") public void updateAuthenticatorConfig(@PathParam("id") String id, AuthenticatorConfigRepresentation rep) Update authenticator configuration- Parameters:
id
- Configuration idrep
- JSON describing new state of authenticator configuration
-
newExecutionConfig(String, AuthenticatorConfigRepresentation)
instead