CAS - SMS Notificatiosn via REST

73 views
Skip to first unread message

Christian Schmidt

unread,
Aug 8, 2019, 10:57:08 AM8/8/19
to CAS Community
Hello @all,

I'm curious to test the SMS REST interface for password management notifications. -> https://apereo.github.io/cas/6.0.x/notifications/SMS-Messaging-Configuration.html

Sadly the documentation on the SMS feature is very small so I had to play with the configurations parameters but couldn't get it to work.



I'm currently running on 6.1.0 RC4-SNAPSHOT with the activated PM module.

The configuration keys for notification by mail are working, but are currently disabled.



According to the documentation the REST Endpoint needs the following values:
        cas.smsProvider.rest.method=POST
        cas.smsProvider.rest.url=http://somedummy.url

When running the CAS with this config, I get the error message saying, that no mail service is configured.



After further searching I found an info saying that the parameters: from, text and attributeName are also needed.
But I don't have the configuration key to use these values.

For example I already tried:
cas.smsProvider.rest.from=
cas.sms.from=
cas.authn.pm.reset.from=
cas.authn.pm.reset.sms.from=


May someone please give me a hint?

Best regards
Christian

Christian Schmidt

unread,
Sep 12, 2019, 12:55:40 PM9/12/19
to CAS Community
Hi,

I've been digging through the documentation and the source for about 2-3 hours now.

It says : "Those who have forgotten their account password may receive a secure link with a time-based expiration policy at their registered email address and/or phone."

To implement this behaviour I followed the link to the SMS Notification Guide.

I set the propertys:
        cas.smsProvider.rest.method=POST
        cas.smsProvider.rest.url=http://somedummy.url
and started the CAS App.

Accoring to the debug log some things happened:
- setting this values initializes the CommunicationsManger class with my defined SmsSender Class -> https://github.com/apereo/cas/blob/master/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/io/CommunicationsManager.java
- following the code of the manager and the code which use the manager, sending SMS is possible

Calling the doExecute method results in an exception, stating that no mail sender is defined. Which is absolutly true.


The problem therefore is, that the whole code for password resets is only working when using emails.
Also there is no call at all to the sendSms function of the CommunicationsManager, therefore it impossible to send a SMS with a reset link.


I already checked the commits for 1 year but it seems that is never worked.



In my opinion, implementing this feature would lead to a generic rest interface which could be used to send the reset-link to another, more specialized service, which would handle the transfer to the user.
In my case I would connect a service which creates mails that are enriched by meta data from my companys CRM system.
One could even connect a service which generates morse code, light signals or something else because the transport channel would be out of the scope from CAS.


Best regards
Christian













Reply all
Reply to author
Forward
0 new messages