https://github.com/messagemedia/auth0-integration
Auth0 SMS integration with MessageMedia
https://github.com/messagemedia/auth0-integration
auth0 authentication integration messagemedia security sms
Last synced: 10 months ago
JSON representation
Auth0 SMS integration with MessageMedia
- Host: GitHub
- URL: https://github.com/messagemedia/auth0-integration
- Owner: messagemedia
- License: apache-2.0
- Created: 2018-09-10T01:23:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-10T02:56:38.000Z (over 6 years ago)
- Last Synced: 2025-03-29T06:51:36.605Z (10 months ago)
- Topics: auth0, authentication, integration, messagemedia, security, sms
- Size: 90.8 KB
- Stars: 3
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Setting up MessageMedia SMS for Auth
[](http://hits.dwyl.io/messagemedia/auth0-integration)
This guide assumes that you've already got your MessageMedia API credentials. If you don't, you can sign up for them for free over [here](https://developers.messagemedia.com/register).
## Auth0 Configuration
Make sure the SMS Passwordless connection is enabled by going to [Connections → Passwordless in your Auth0 account](https://manage.auth0.com/#/connections/passwordless) and switch it on. You can configure everything through the UI except for choosing a different provider. You can enter dummy values for Twilio SID and AuthToken.
To change the provider to MessageMedia, you need to use the Management API. To get an access token, go to the [API Explorer tab of your Auth0 Management API](https://manage.auth0.com/#/apis/management/explorer). You can use the API Explorer directly, curl or Postman.

If you use the API Explorer, you need to add the access token and tenant URL to it:

Using your access token, make a GET request to `https://{YOURTENANT}.auth0.com/api/v2/connections` to find out the ID for your SMS connection. You can make that request [in the API Explorer](https://auth0.com/docs/api/management/v2#!/Connections/get_connections) by clicking **Try**.

Go through the returned JSON to find the connection named `sms` and take note of the ID to use in the next step. Also, copy the `options` object.

Next, make a PATCH request to `https://{YOURTENANT}.auth0.com/api/v2/connections/{CONNECTION_ID}`, using the connection ID you found. You can do that [in the API Explorer](https://auth0.com/docs/api/management/v2#!/Connections/patch_connections_by_id). The body of the request must be the existing `options` object with these edits: remove `twilio_sid` and `twilio_token` and instead add the following entries.
````json
"provider": "sms_gateway",
"gateway_url": "https://auth0-api.messagemedia.com/messages",
"gateway_authentication": {
"method": "bearer",
"subject": "{YOUR_API_KEY}",
"audience": "{YOUR_API_SECRET}",
"secret": "MessageMedia"
},
"from": "{SENDER_PHONE_NUMBER}",
````
Enter your Message Media API key and secret as `subject` and `audience` in the `gateway_authentication` section. The `secret` is hardcoded to the string `MessageMedia`. `from` is the sender's phone number.
Send the request (**Try** in the API explorer) to store the configuration.

Once that's done, you can change to the _Try_ tab in the Auth0 UI for the SMS Connection, enter your phone number and hit **Try**. An authentication code message should arrive on your phone.