keycloak-service
公開メンバ関数 | 静的公開変数類 | 静的変数 | 静的非公開変数類 | 全メンバ一覧
org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory クラス
org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory の継承関係図
Inheritance graph
org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory 連携図
Collaboration graph

公開メンバ関数

Authenticator create (KeycloakSession session)
 
void init (Config.Scope config)
 
void postInit (KeycloakSessionFactory factory)
 
void close ()
 
String getId ()
 
String getReferenceCategory ()
 
boolean isConfigurable ()
 
boolean isUserSetupAllowed ()
 
AuthenticationExecutionModel.Requirement [] getRequirementChoices ()
 
String getDisplayType ()
 
String getHelpText ()
 
List< ProviderConfigProperty > getConfigProperties ()
 
boolean isSupported ()
 

静的公開変数類

static final String PROVIDER_ID = "auth-script-based"
 

静的変数

static final AuthenticationExecutionModel.Requirement [] REQUIREMENT_CHOICES
 
static final ScriptBasedAuthenticator SINGLETON = new ScriptBasedAuthenticator()
 

静的非公開変数類

static final Logger LOGGER = Logger.getLogger(ScriptBasedAuthenticatorFactory.class)
 

詳解

An AuthenticatorFactory for ScriptBasedAuthenticators.

著者
Thomas Darimont

関数詳解

◆ close()

void org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.close ( )
inline
82  {
83  //NOOP
84  }

◆ create()

Authenticator org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.create ( KeycloakSession  session)
inline
60  {
61 
62  /*
63  would be great to have the actual authenticatorId here in order to initialize the authenticator in the ctor with
64  the appropriate config from session.getContext().getRealm().getAuthenticatorConfigById(authenticatorId);
65 
66  This would help to avoid potentially re-evaluating the provide script multiple times per authenticator execution.
67  */
68  return SINGLETON;
69  }
static final ScriptBasedAuthenticator SINGLETON
Definition: ScriptBasedAuthenticatorFactory.java:57

◆ getConfigProperties()

List<ProviderConfigProperty> org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.getConfigProperties ( )
inline
122  {
123 
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.");
129 
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.");
135 
136  ProviderConfigProperty script = new ProviderConfigProperty();
137  script.setType(SCRIPT_TYPE);
138  script.setName(SCRIPT_CODE);
139  script.setLabel("Script Source");
140 
141  String scriptTemplate = "//enter your script code here";
142  try {
143  scriptTemplate = StreamUtil.readString(getClass().getResourceAsStream("/scripts/authenticator-template.js"));
144  } catch (IOException ioe) {
145  LOGGER.warn(ioe);
146  }
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'");
150 
151  return asList(name, description, script);
152  }
static final Logger LOGGER
Definition: ScriptBasedAuthenticatorFactory.java:48

◆ getDisplayType()

String org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.getDisplayType ( )
inline
112  {
113  return "Script";
114  }

◆ getHelpText()

String org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.getHelpText ( )
inline
117  {
118  return "Script based authentication. Allows to define custom authentication logic via JavaScript.";
119  }

◆ getId()

String org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.getId ( )
inline
87  {
88  return PROVIDER_ID;
89  }
static final String PROVIDER_ID
Definition: ScriptBasedAuthenticatorFactory.java:50

◆ getReferenceCategory()

String org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.getReferenceCategory ( )
inline
92  {
93  return "script";
94  }

◆ getRequirementChoices()

AuthenticationExecutionModel.Requirement [] org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.getRequirementChoices ( )
inline
107  {
108  return REQUIREMENT_CHOICES;
109  }
static final AuthenticationExecutionModel.Requirement [] REQUIREMENT_CHOICES
Definition: ScriptBasedAuthenticatorFactory.java:52

◆ init()

void org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.init ( Config.Scope  config)
inline
72  {
73  //NOOP
74  }

◆ isConfigurable()

boolean org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.isConfigurable ( )
inline
97  {
98  return true;
99  }

◆ isSupported()

boolean org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.isSupported ( )
inline
155  {
156  return Profile.isFeatureEnabled(Profile.Feature.SCRIPTS);
157  }

◆ isUserSetupAllowed()

boolean org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.isUserSetupAllowed ( )
inline
102  {
103  return true;
104  }

◆ postInit()

void org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.postInit ( KeycloakSessionFactory  factory)
inline
77  {
78  //NOOP
79  }

メンバ詳解

◆ LOGGER

final Logger org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.LOGGER = Logger.getLogger(ScriptBasedAuthenticatorFactory.class)
staticprivate

◆ PROVIDER_ID

final String org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.PROVIDER_ID = "auth-script-based"
static

◆ REQUIREMENT_CHOICES

final AuthenticationExecutionModel.Requirement [] org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.REQUIREMENT_CHOICES
staticpackage
初期値:
= {
AuthenticationExecutionModel.Requirement.REQUIRED,
AuthenticationExecutionModel.Requirement.OPTIONAL,
AuthenticationExecutionModel.Requirement.DISABLED}

◆ SINGLETON

final ScriptBasedAuthenticator org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory.SINGLETON = new ScriptBasedAuthenticator()
staticpackage

このクラス詳解は次のファイルから抽出されました: