public class TelekomSMSTokenProvider extends SMSTokenProvider
The telekomSMSTokenProvider randomly generates a 6-digit token after the user entered her correct password.
The token is then sent to the user via text message. The user's attribute sms is used as the recipient phone number. If this attribute has not been provided by the user data provider, the login attempt fails.
The text message is sent via Deutsche Telekom's developer garden REST API. To use this API, a registered user account with sufficient balance is necessary and the Send SMS API has to be enabled for this account. Membrane Service Proxy must be registered as an "application" on the developer garden website, and the "Global SMS API" must be enabled both for the user account as well as the registered application. Once completed, the scope, clientId and clientSecret settings must be copied from the website into Membrane's proxies.xml configuration file. Membrane uses these three parameters to identify itself when connecting to the Telekom API Gateway.
When using a non-standard environment (see https://www.developergarden.com/apis/documentation/bundle/telekom-api-rest/html/sendsms.html#environmental_infos for more information), the parameters senderName and senderAddress may be used to set the SMS sender address and name.
The token is prepended by prefixText to generate the text message's text.
If normalizeTelephoneNumber is set, the user's sms attribute will be normalized according to the following rules before using it:
| Modifier and Type | Class and Description |
|---|---|
static class |
TelekomSMSTokenProvider.EnvironmentType |
prefixText| Constructor and Description |
|---|
TelekomSMSTokenProvider() |
| Modifier and Type | Method and Description |
|---|---|
String |
getClientId() |
String |
getClientSecret() |
TelekomSMSTokenProvider.EnvironmentType |
getEnvironment() |
String |
getScope() |
String |
getSenderAddress() |
String |
getSenderName() |
void |
init(Router router) |
protected String |
normalizeNumber(String number) |
protected void |
sendSMS(String text,
String recipientNumber) |
void |
setClientId(String clientId) |
void |
setClientSecret(String clientSecret) |
void |
setEnvironment(TelekomSMSTokenProvider.EnvironmentType environment) |
void |
setScope(String scope) |
void |
setSenderAddress(String senderAddress) |
void |
setSenderName(String senderName) |
getPrefixText, isSimulate, requestToken, setPrefixText, setSimulategenerateToken, verifyTokenpublic void init(Router router)
protected String normalizeNumber(String number)
normalizeNumber in class SMSTokenProviderprotected void sendSMS(String text, String recipientNumber)
sendSMS in class SMSTokenProviderpublic String getScope()
public void setScope(String scope)
public String getClientId()
public void setClientId(String clientId)
public String getClientSecret()
public void setClientSecret(String clientSecret)
public String getSenderName()
public void setSenderName(String senderName)
public String getSenderAddress()
public void setSenderAddress(String senderAddress)
public TelekomSMSTokenProvider.EnvironmentType getEnvironment()
public void setEnvironment(TelekomSMSTokenProvider.EnvironmentType environment)
Copyright © 2022. All Rights Reserved.