3
votes

I checked the axi2.xml file and output-event-adapter.xml file. For email OTP, it is mentioned to configure email in axis2.xml file https://docs.wso2.com/display/IS570/Configuring+Email+OTP.

But for user self-registration, it is asked to configure email in output-event adapter.xml file. https://docs.wso2.com/display/IS570/Self-Registration+and+Account+Confirmation.

Why there are two places for email configuration? How sending email notification works in user self-registration in WSO2 IS 5.7.0?

Thanks in advance!

1

1 Answers

2
votes

WSO2IS contains an email sending module with WSO2IS which is based on Axis2. This handles the email notifications in Email OTP.[1,2] Those configurations are stored in axis2.xml.But for instances like Ask Password Account Confirmation and user self-registration. WSO2 Is uses email event adapters[3]. These adapters get the configuration from output-event-adapter.xml.

Current Email Sending architecture using email event adapters in wso2 is this is described in mail thread[4]

In the above image global adapter configs are defined in the output-event-adapters.xml. And each adapter created per tenant holds a connection with the configured smtp server. When a tenant needs to send an email it publish the content to the relevant stream[5]

This stream creates the mapping to the relevant publisher using the stream wso2 is resolves the publisher. These publishers are defined in

IS-HOME/repository/deployment/server/eventpublishers

these publishers specify the relevant adapter which has a connection with the SMTP server. It sends the email using that connection. This is how email sending handled in user self-registration. This has been further explained in[4]. As WSO2 IS has those two different mechanisms to handle notification you have to configure in two places for email OTP and account confirmation.As WSO2IS deprecating the Axis2 Based notification model.

if you enabled the property

<Parameter name="useEventHandlerBasedEmailSender">true</Parameter> 

As per the documentation[6]. You can use the configurations in the output-event-adapter.xml for email otp. [7] But this supports after identity server 5.8.0.

1. https://github.com/wso2-extensions/identity-outbound-auth-email-otp/blob/f6ebf84f35d9da526077a0bfe220665e71baa7ec/component/authenticator/src/main/java/org/wso2/carbon/identity/authenticator/emailotp/EmailOTPAuthenticator.java#L1708

[2]. https://github.com/wso2/carbon-identity-framework/blob/34bb9053787020dbc901d17d7ee4290f075e6542/components/identity-mgt/org.wso2.carbon.identity.mgt/src/main/java/org/wso2/carbon/identity/mgt/mail/DefaultEmailSendingModule.java#L73

[3]. https://github.com/wso2/carbon-analytics-common/blob/5.2.x/components/event-publisher/event-output-adapters/org.wso2.carbon.event.output.adapter.email/src/main/java/org/wso2/carbon/event/output/adapter/email/EmailEventAdapter.java

[4]. http://mail.wso2.org/mailarchive/architecture/2019-September/032587.html

[5].https://github.com/wso2-extensions/identity-event-handler-notification/blob/master/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/src/main/java/org/wso2/carbon/identity/event/handler/notification/DefaultNotificationHandler.java#L284

[6]. https://docs.wso2.com/display/IS580/Configuring+Email+OTP

[7]. https://github.com/wso2-extensions/identity-outbound-auth-email-otp/pull/26/files#diff-868475e354da25fd06fae3b3a9ebe6e5R272