124 ProviderConfigProperty name =
new ProviderConfigProperty();
125 name.setType(STRING_TYPE);
126 name.setName(SCRIPT_NAME);
127 name.setLabel(
"Script Name");
128 name.setHelpText(
"The name of the script used to authenticate.");
130 ProviderConfigProperty description =
new ProviderConfigProperty();
131 description.setType(STRING_TYPE);
132 description.setName(SCRIPT_DESCRIPTION);
133 description.setLabel(
"Script Description");
134 description.setHelpText(
"The description of the script used to authenticate.");
136 ProviderConfigProperty script =
new ProviderConfigProperty();
137 script.setType(SCRIPT_TYPE);
138 script.setName(SCRIPT_CODE);
139 script.setLabel(
"Script Source");
141 String scriptTemplate =
"//enter your script code here";
143 scriptTemplate = StreamUtil.readString(getClass().getResourceAsStream(
"/scripts/authenticator-template.js"));
144 }
catch (IOException ioe) {
147 script.setDefaultValue(scriptTemplate);
148 script.setHelpText(
"The script used to authenticate. Scripts must at least define a function with the name 'authenticate(context)' that accepts a context (AuthenticationFlowContext) parameter.\n" +
149 "This authenticator exposes the following additional variables: 'script', 'realm', 'user', 'session', 'authenticationSession', 'httpRequest', 'LOG'");
151 return asList(name, description, script);
static final Logger LOGGER
Definition: ScriptBasedAuthenticatorFactory.java:48