I'm not convinced about this approach, I think it would end up being complex and
we'd continuously get request on tweaking it to support other providers.
Having a simple Java interface with something like (just a quick mock, not the suggested
interface):
SMSProvider:
* Status sendMessage(String message, String phoneNumber)
Would be fairly easy for users to implement and would work for all services.
----- Original Message -----
From: "Thomas Raehalme"
<thomas.raehalme(a)aitiofinland.com>
To: "Stian Thorgersen" <stian(a)redhat.com>
Cc: "Bill Burke" <bburke(a)redhat.com>, "keycloak-dev"
<keycloak-dev(a)lists.jboss.org>
Sent: Monday, 17 August, 2015 11:29:34 AM
Subject: Re: [keycloak-dev] Abstract SMS support
On Mon, Aug 17, 2015 at 12:18 PM, Stian Thorgersen <stian(a)redhat.com> wrote:
> > However it might be a good idea to include a generic HTTP/REST
> implementation
> > which you could configure through the admin interface to deliver SMS
> > messages to any service supporting HTTP? I'm pretty sure this would
> satisfy
> > most users.
>
> Not sure how that would work. AFAIK SMS providers have their own
> proprietary rest endpoints as well as authentication mechanisms so I don't
> see how we could create a generic implementation.
>
>
You would need to implement a template mechanism where the Keycloak data
(for example the recipient number and message text) is provided as
keywords, and the admin defines the template utilizing those keywords. It
would be a good idea to allow choosing between POST and GET.
For example Twilio supports a simple HTTP POST operation to delivery SMS
messages through their API:
https://www.twilio.com/docs/api/rest/sending-messages
Many operators and service providers use a similar mechanism. Often the
authentication is just a simple token which needs to be included in the
request.
Best regards,
Thomas