Twilio receiving Azure B2C MFA SMS - twilio

I have setup the following:
Azure B2C
Standard user flow
MFA turned on
Twilio account
a US number
a messaging service with web hook
Rest API
Accept POST call from Twilio web hook
I want Azure B2C MFA to send SMS to Twilio and Twilio then trigger a call with the message content to my Rest API.
I have tried this setup and it worked the first two times. However, all subsequent attempts were not successful. I cannot see the received message count in Twilio increase, after MFA SMS is sent from Azure B2C.
Is there any way to find out why this stopped working and is there any settings to configuration that I may have missed configuring?
Any help would be much appreciated.

Related

Azure static web app - send email from the logged in user a week later. How to handle authentication?

I have an azure static web app set up with durable functions. I want the user to log in with their microsoft account, write a message and an email address, and that email will be sent a week later using the MS Graph Api.
I don't want to use Mail.Send application permissions as this lets the app send from anyone in the organisation. So I have Mail.Send delegated permissions.
After the user logs in, how can I send mail a week later, as the access token will have expired? Do I need to handle the refresh token manually or is there a built in way Azure Static Web Apps does this?
No built in way. You will have to manually refresh the token in your backend until you need to send the email out.

Allow Azure AD app to send mails on behalf of only one specific user

I'm building a daemon service (no user interaction) which needs to send a mail via MS Graph. I've registered an app in Azure AD and given it the User.Read.All and Mail.Send application permissions and given admin consent for those.
In my Java code, I'm using the ClientSecretCredentialBuilder for authentication. By doing
graphServiceClient.users("johndoe#mytenant.com").sendMail(params).buildRequest().post();
I can send an email on behalf of John Doe. However, technically, I could send an email on behalf of any user in this tenant. Is there a way to configure the app so that it can only use a specific account to send mail from?
Graph API doesn't yet support such a feature.

Cannot validate Twilio webhook signatures for calls from authorized, Connect subaccounts

We're using Twilio Connect to allow our users to connect their Twilio accounts to ours. We provision a number for their subaccount, and set the messaging webhook to POST to our server.
We try to validate the request using the Twilio node library validateRequest method but validation always fails. I think that's because we're passing our client secret to validate a request that's coming from our user's Twilio account.
How should validate Twilio webhook calls that come from accounts we're authorized to use (but are not our own accounts)?
This might be a permissions thing! There are two permissions available for Twilio Connect Apps -- Read all account data & Charge account for usage! You would only be able to have full autonomy over a users account & subaccounts if you use the "Read all account data" permission when setting up the Connect App.

How to connect Twilio SIP Domain to a twilio studio flow?

On Twilio I configured a Sip Domain and I created a flow in Twilio Studio. I want to connect them so when I call the number registered in the SIP Domain I want the call connected to the flow in Twilio Studio.
How can I do that?
Twilio staff here. You should be able to do this using your Studio Flow's webhook URL.
To find the webhook for your flow, click on the flow's trigger:
Then copy and paste the webhook URL into your SIP domain's voice configuration:
Click "Save" at the bottom of the SIP domain configuration page and incoming calls will trigger your Studio Flow.

Azure AD App-only token to consume outlook REST API

I am developing a console app in .net which will send mail using the Azure AD application. I followed all the step from generating the certificates to registered an application in Azure AD. Then provided the application permission (Send mail as any user) using Microsoft graph API and provided it “grant permission” as an admin consent.
In my console app code I uses the below outlook api to send mail as
resourseurl — https://outlook.office.com/api/v1.0/users/{my email account}/sendmail. After providing grant permission to my app I am still facing the 401:unauthorized error.
You gave permissions to Microsoft Graph API, so you need to use it.
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_sendmail
The URL that you need to use is thus:
POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/sendMail
Internally the graph API does call the API you mentioned. But your token is for the graph. Not the outlook API.
You also mentioned the resource URL. The graph API resource URL is https://graph.microsoft.com.

Resources