authgear / authgear-server

Open source alternative to Auth0 / Firebase Auth
https://www.authgear.com
Apache License 2.0
83 stars 37 forks source link

Other SMS providers (SMS gateway) #3183

Open fungc-io opened 1 year ago

fungc-io commented 1 year ago

Problem

Allow user to use their own SMS gateway for sending messages. This feature is supported in the backend in https://github.com/authgear/authgear-server/issues/2829 In this pitch, we are adding the configuration in the portal and the relevant documentation

Appetite

2 weeks

Solution

User can choose from the following providers in the portal

If the latter 2 are selected, some configurations presented in the portal

Twilio

Twilio is the most popular service, the user will only need to provide:

Custom It's supported the SMS messaging hook. There are 2 modes:

import { CustomSMSGatewayPayload } from "https://deno.land/x/authgear-deno-hook@0.1.0/mod.ts";

export default async function (e: CustomSMSGatewayPayload): Promise<void> {
  const response = await fetch("https://some.sms.gateway");
  if (!response.ok) {
    throw new Error("Failed to send sms");
  }
}

Rabbit holes

Details about the solution worth calling out to avoid problems

No-goes

Functionality or use cases we intentionally aren’t covering to fit the appetite

hlh112 commented 1 year ago

@fungc-io figma updated

fungc-io commented 1 year ago

Thanks @hlh112, it looks good, left a trivial comment in the figma Can you also create a sample screen for revamping the header position?

Similar to what we did here: https://www.figma.com/file/msiE4O5imHONAG5EjhZeiZ/Authgear-UI?type=design&node-id=9245%3A97825&mode=design&t=OxPjMLhmxCz9mikV-1

hlh112 commented 1 year ago

@fungc-io both comments updated~

fungc-io commented 1 year ago

lgtm, thanks!