FusionAuth / fusionauth-issues

FusionAuth issue submission project
https://fusionauth.io
91 stars 12 forks source link

Allow for plugins to extend messaging capabilities #1566

Closed mooreds closed 2 years ago

mooreds commented 2 years ago

Allow for plugins to extend messaging capabilities

This is something that came up discussing messenger options with a partner.

Problem

I'd like to be able to use some other form of delivering a code than Twilio SMS and the generic messenger. I'd like to be able to add a plugin the same way I can with password hashing.

Solution

Come up with a generic interface/base class that I can implement to provide messaging across other transports. It could just have a send method.

This probably needs some design thinking, but at a minimum should pass:

I'm not sure how you get around configuration (which will differ between messengers) but maybe just have that included in the configuration as a properties file?

Alternatives/workarounds

The generic messenger works as long as the configuration matches what the generic messenger offers (a URL and custom headers). If I want anything more complicated (a from telephone number that lives in the form body, for example) I need to set up a custom webapp at a URL myself with some configuration stored in that.

Additional context

Add any other context or screenshots about the feature request here.

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

How to vote

Please give us a thumbs up or thumbs down as a reaction to help us prioritize this feature. Feel free to comment if you have a particular need or comment on how this feature should work.

robotdan commented 2 years ago

We built the generic messenger for this use case. We don't have any intention to open up this up through a plugin.

Is there any particular limitation of the Generic Messenger that would be solved by the plugin?

mooreds commented 2 years ago

Sure. The generic messenger doesn't work with anything that doesn't take a URL and custom headers.

Here's an example of an integration that (as far as I can tell) won't work with the generic messenger:

https://developers.telnyx.com/docs/v2/messaging / https://developers.telnyx.com/docs/v2/messaging/quickstarts/sending-sms-and-mms

You need to be able to provide JSON data to the API:

  --data '{
    "from": "+13115552368",
    "to": "+13115552367",
    "text": "Hello, world!"
  }' \

Maybe I'm missing something, but I don't see how to do that with the Generic Messenger.

robotdan commented 2 years ago

Ah, ok, I think I see where you are coming from.

The intended use of the generic connector is not to directly connect to 3rd party systems. As you point out, this would likely never work.

Instead, we expect the implementor to write glue code to accept a request from the Generic connector and then make a request to the 3rd party. So essentially you would write a small proxy between FusionAuth and the desired 3rd party service.

mooreds commented 2 years ago

That's good to know. We should update the documentation. Will take a todo.

robotdan commented 2 years ago

I though we did describe this already in the doc, but it is possible we are making too many assumptions and it isn’t clear enough.

mooreds commented 2 years ago

Closing this because it's handled in this PR: https://github.com/FusionAuth/fusionauth-site/pull/1198