c8d47926b8
This is a POC for script based authenticator support. Introduced a ScriptBasedAuthenticator that is bootstraped via a ScriptBasedAuthenticatorFactory can be execute a configured script against a provided execution context. Added an alias property to the AuthFlowExecutionRepresentation in order to be able to differentiate multiple instances of an Authenticator within the same AuthFlow. For convenience editing the AngularJS bindings for the ACE editor were added for fancy script editing - this needs to be cut down a bit wrt to themes and supported scripts - e.g. we probably don't expect users to write authenticator scripts in Cobol... Removed currently not needed ACE sytax highlighting and themes. Scripting is now available to all keycloak components that have access to the KeycloakSession. Introduced new Scripting SPI for configurable scripting providers.
25 lines
No EOL
642 B
Java
25 lines
No EOL
642 B
Java
package org.keycloak.scripting;
|
|
|
|
import javax.script.Bindings;
|
|
|
|
/**
|
|
* Callback interface for customization of {@link Bindings} for a {@link javax.script.ScriptEngine}.
|
|
*
|
|
* @author <a href="mailto:thomas.darimont@gmail.com">Thomas Darimont</a>
|
|
*/
|
|
@FunctionalInterface
|
|
public interface ScriptBindingsConfigurer {
|
|
|
|
/**
|
|
* A default {@link ScriptBindingsConfigurer} leaves the Bindings empty.
|
|
*/
|
|
ScriptBindingsConfigurer EMPTY = new ScriptBindingsConfigurer() {
|
|
|
|
@Override
|
|
public void configureBindings(Bindings bindings) {
|
|
//NOOP
|
|
}
|
|
};
|
|
|
|
void configureBindings(Bindings bindings);
|
|
} |