April 27, 2020 at 9:39 pm #27846
We have an usecase with OpenAM user self registration with sending verification email to user, and registration completes after user clicks on the verification email. Now this is a OOB usecase but only problem is we cannot use the Email server configuration to send emails. The reason being our email is cloud service and they cannot open SMTP port to receive requests from OpenAM servers. So we want to use a service like Twilio to send user verification email? How to acheive this?
sireeshaApril 28, 2020 at 3:49 am #27847Jatinder SinghParticipant
I suggest looking into
Twilio Verify Auth Nodeson Marketplace. It taps into Twilio’s verify service and you could configure
READMEdoc of the auth node.
Hope it helps!April 28, 2020 at 3:27 pm #27852
Thanks Jaitnder, I alredy looked into this. This will help us to implement 2-factor authn using Twilio or some other service to send OTP. But the usecase here is for User-Self registration as shown in this guide
For user to receive that confirmation email and click verify, we need to configure email server in Global/Realm settings. Which is where my challenge is.
One of the flows here show a custom plug-in, but I dont see much information on how to invoke a custom plug-in in user registration flow. Could you point me with some sample code and also document on how to invoke this custom plugin.April 28, 2020 at 4:46 pm #27853Jatinder SinghParticipant
You can override
Advanced Configurationto provide custom user registration option. That said, I believe Twilio uses SendGrid for email verification. SendGrid provides multiple ways to tap into their service e.g. API, SMTP and Marketing Campaigns. You may want to look into their SMTP documentation at the below link:
https://sendgrid.com/docs/for-developers/sending-email/getting-started-smtp/April 29, 2020 at 11:28 am #27855Andy CoryParticipant
An alternative option to that proposed by Jatinder is to override the use of the default mail-sending class in the Email Service provider. By default this is
org.forgerock.openam.services.email.MailServerImpl. The methods in this class have access to the registration mail content; mail body, subject, the link back into AM including the tracking JWT etc. Instead of sending via SMTP, your own implementation could hook into another mechanism. We’ve done this to construct an XML document containing the email info and send it via an OAuth2 REST endpoint to IBM’s Transact marketing platform, for example.
-AndyApril 29, 2020 at 3:23 pm #27856
Thanks Andy, this is very helpful. I will look into the SDK documentation. Is there a sample code which we can use?April 30, 2020 at 9:58 pm #27875Scott HegerParticipant
All the samples ForgeRock provides can be found at https://stash.forgerock.org/projects/OPENAM/repos/am-external/browse. There doesn’t appear to be a sample for a custom MailServerImpl though. Through your support contract you can request access to the full AM source code where you could see the OOTB MailServerImpl and model your own after that. If that doesn’t work you could look for an older version that can be found online (e.g. https://github.com/OpenRock/OpenAM/blob/master/openam-core/src/main/java/org/forgerock/openam/services/email/MailServerImpl.java)May 1, 2020 at 12:25 pm #27878Andy CoryParticipant
Not that I know of. But the default mail server implementation class,
org.forgerock.openam.services. MailServerImplis available in various online repos so you can see what objects are available to the methods and how the mail is constructed to send to the SMTP server. It should be simple enough to use that code as a basis to use a different method than SMTP to send the message.
You must be logged in to reply to this topic.