Feedback : self-service - Howto setup Vonage Nexmo SMS service

The Vonage/Nexmo is the lowest price sms provider I found.
Here you’ll find a working setup script.
Regards

ucr set umc/self-service/passwordreset/external/method='sms'
ucr set umc/self-service/passwordreset/external/method_label='sms'
ucr set umc/self-service/passwordreset/external/udm_property='PasswordRecoveryMobile'
ucr set umc/self-service/passwordreset/external/token_length='8'
ucr set umc/self-service/passwordreset/external/command='/usr/local/sbin/vonage_sms.sh'
ucr set umc/self-service/passwordreset/external/enabled='yes'

cat > /usr/local/sbin/vonage_sms.sh <<EOF
#!/bin/sh
#%0a = newline

curl -X "POST" "https://rest.nexmo.com/sms/json" \
     -d "from=XXXXX" \
     -d "text=Hy $selfservice_username, %0aHere you'll find your reset token : %0a$selfservice_token. %0aRegards" \
     -d "to=$selfservice_address" \
     -d "api_key=XXXXXX" \
     -d "api_secret=XXXXX"
EOF

chmod a+x /usr/local/sbin/vonage_sms.sh
systemctl restart univention-self-service-invitation.service
1 Like
Mastodon