← Back to plugin index

Email Identity Verification Step

Description

Public self-service flow step that verifies the user identity by sending an email with an OTP that the user has to enter correctly for the flow to continue.

This is an identity verification step that differs from a general "factor check" step in the following ways:

  • It doesn't fail with non-existing users or users without an email address.
  • It implements stealth mode: if a user does not exist or cannot do a public self-service for whatever reason, no error is returned, but any OTP entered is rejected, so that the step can never be completed successfully.
Type name
EmailIdentityVerificationStep
Class
com.airlock.iam.publicselfservice.application.configuration.steps.EmailIdentityVerificationStepConfig
May be used by
Properties
Email Item (emailContextData)
Description
The context data field that contains the email address of the user.
Attributes
Plugin-Link
Mandatory
Assignable plugins
Email Service (emailService)
Description
Email service for sending emails.
Attributes
Plugin-Link
Mandatory
Assignable plugins
OTP Generator (otpGenerator)
Description
Secret string generator to create the OTP. Make sure that the code is long enough to prevent brute-force attacks (by restarting the flow multiple times).
Attributes
Plugin-Link
Optional
Assignable plugins
Subject Resource Key (subjectResourceKey)
Description
The resource key for the email subject. The replacement variables described for "Body Resource Key" are also available here.
Attributes
String
Optional
Default value
public-self-service.email.otp.subject
Body Resource Key (bodyResourceKey)
Description

The resource key for the email message body.

The following syntax can be used to include data in the template:

  • ${TOKEN} to include the generated OTP.
  • ${USERNAME} to include the name of the user (as entered to initiate the public self-service).
  • ${Now,date,format} to include the current date/time, where "format" is a date pattern like "yyyy-MM-dd HH:mm:ss".
  • ${contextDataName} to include the value of the context data field "contextDataName". Note that only context data of type "string" can be included.

Note that unreplaced variables result in a failure and no email is sent. Therefore, only variable names should be used that are guaranteed to be available when the email verification is performed.

Attributes
String
Optional
Default value
public-self-service.email.otp.body
Max Failed Attempts (maxFailedAttempts)
Description
Number of allowed failed attempts before the flow is aborted.
Attributes
Integer
Optional
Default value
1
OTP Validity [s] (otpValidity)
Description
Determines how long the OTP is valid (in seconds).
Attributes
Integer
Optional
Default value
300
Otp Case Sensitive (otpCaseSensitive)
Description
If enabled, the case of characters is considered when matching the entered otp against the generated one.
Attributes
Boolean
Optional
Default value
true
Send As HTML (sendAsHtml)
Description

If enabled, the verification email will be sent as an HTML mail. Otherwise it will be sent as plain text.

Security Warning: If e-mails are sent as HTML, make sure to properly escape values originating from untrusted sources (such as user input during self-registration). This can be achieved by enabling the property 'Escape Values in HTML'.

Attributes
Boolean
Optional
Default value
false
Escape Values in HTML (escapeHtmlValues)
Description

HTML-escape all provided values if property Send As HTML is enabled.

Security Warning: If e-mails are sent as HTML, make sure to properly escape values originating from untrusted sources (such as user input during self-registration). This can be achieved by enabling the property 'Escape Values in HTML'.

Attributes
Boolean
Optional
Default value
true
Authentication Method ID (authenticationMethodId)
Description
The identifier of the authentication method for this step. Since the authentication method is also the identifier for failed login attempts for this step, distinct identifiers must be chosen if multiple instances of the same step type are used to check different credentials (e.g., two password step instances check two different passwords).

Example: a system tracks two passwords per user. Password 1 is used in flow A, password 2 in flow B. These two steps must have distinct 'Authentication Method Ids', e.g. PASSWORD1 and PASSWORD2.

If only one identifier (e.g. "PASSWORD") is used, this may allow brute force attacks on the password as follows. Assuming an attacker knows the user's password 1, they get an unlimited number of attempts on flow B, as the 'PASSWORD' counter can repeatedly be reset to 0 by performing a successful login on flow A.

To prevent such attacks, use two different counters by setting the authentication methods, for example, to PASSWORD1 and PASSWORD2, respectively.

Attributes
String
Optional
Length <= 23
Default value
EMAIL
Interactive Goto Targets (interactiveGotoTargets)
Description
Manually selectable Goto targets. These are steps to which the user can chose to jump when this is the current flow step.
Attributes
Plugin-List
Optional
Assignable plugins
Dynamic Step Activations (dynamicStepActivations)
Description
Steps that can be dynamically activated while in this step.
Attributes
Plugin-List
Optional
Assignable plugins
Skip Condition (skipCondition)
Description

If this condition is configured and fulfilled, the step is skipped and the flow execution continues with the subsequent step.

Attributes
Plugin-Link
Optional
Assignable plugins
Pre Condition (preCondition)
Description
This step is executed only if the configured pre condition is fulfilled. If the condition is not fulfilled, the step and flow execution fail immediately. The step is not initialized and no step method can be called. If no condition is configured, the behavior is that of a fulfilled pre condition.
Attributes
Plugin-Link
Optional
Assignable plugins
Requires Activation (requiresActivation)
Description
If enabled, this step is only executed if it has been dynamically activated from a previous step. If it has not been activated, the step is skipped (equivalent to when the skip condition is fulfilled).
Attributes
Boolean
Optional
Default value
false
Tags On Success (tagsOnSuccess)
Description
This step grants these tags if it completes successfully.
Attributes
Plugin-List
Optional
Assignable plugins
Step ID (stepId)
Description
ID of this step. This is only needed if this step is the target of a goto action or if this step requires activation.
Attributes
Plugin-Link
Optional
Assignable plugins
On Failure Gotos (onFailureGotos)
Description

If the step fails (no retry) and a goto target for the error code is defined here, the flow does not fail and instead a "goto" to the specified target step is executed. Note that even when the "goto" is executed, any error codes that are considered a failed factor attempt will still increment the "failed attempts" counter, and may lead to the user being locked. Therefore, this may still result in a failed flow.

A typical application of this feature is switching to an alternative authentication factor step, if an external service (e.g. Futurae server, SMS gateway) is not available (error code EXTERNAL_SERVICE_UNAVAILABLE with "Strict Counting" disabled, which will not increment the "failed attempts" counter). Other error codes can be found in the IAM REST documentation, in both the general "Error Codes" section and in the documentation of specific endpoints.

Attributes
Plugin-Map
Optional
Assignable plugins
Custom Response Attributes (customResponseAttributes)
Description

A list of custom attributes that are returned in the REST response in addition to the standard attributes the step already returns. The custom attributes defined here are only returned if the step result does not lead to an error response.

Custom attributes are added to the response when a step is initialized and when actions are executed on the step. They will therefore be available in the response leading to this step, and in any responses from endpoints specific to this step. For non-interactive steps, custom attributes are accumulated and added to the response leading to the next interactive step.

Custom attributes are not returned for 'retrieve' endpoints.

Attributes
Plugin-List
Optional
Assignable plugins
YAML Template (with default values)

type: EmailIdentityVerificationStep
id: EmailIdentityVerificationStep-xxxxxx
displayName: 
comment: 
properties:
  authenticationMethodId: EMAIL
  bodyResourceKey: public-self-service.email.otp.body
  customFailureResponseAttributes:
  customResponseAttributes:
  dynamicStepActivations:
  emailContextData:
  emailService:
  escapeHtmlValues: true
  interactiveGotoTargets:
  maxFailedAttempts: 1
  onFailureGotos:
  otpCaseSensitive: true
  otpGenerator:
  otpValidity: 300
  preCondition:
  requiresActivation: false
  sendAsHtml: false
  skipCondition:
  stepId:
  subjectResourceKey: public-self-service.email.otp.subject
  tagsOnSuccess: