FusionAuth / fusionauth-issues

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

No error message is returned for a failed generic messenger call #1573

Open mooreds opened 2 years ago

mooreds commented 2 years ago

No error message is returned for a failed generic messenger call

Description

If I set up a generic messenger and it returns a status code outside of 200-299 range, I'd expect some kind of notification. But it appears that the error message is swallowed.

Affects versions

1.32.1

Steps to reproduce

  1. Set up a user and tenant with SMS MFA.
  2. Create a generic messenger. Have the URL be https://httpbin.org/status/401 which always returns a 401.
  3. Configure the tenant to use the generic messenger.
  4. Open up an incognito window and log in as the user with MFA enabled.
  5. When you get to the MFA screen, there is no notice that the call to the generic messenger failed.

Expected behavior

I'd like to see:

Related

Community guidelines

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

Additional context

We should update the docs added in this PR with information about how the error message is displayed when the message receiver fails to return a 200:

mooreds commented 2 months ago

If no response is sent at all, FusionAuth may throw an error in the system logs. It might look like this

2024-07-24 05:21:31.317 PM ERROR io.fusionauth.app.primeframework.error.ExceptionExceptionHandler - An unhandled exception was thrown
org.primeframework.mvc.PrimeException: The action [class io.fusionauth.app.action.api.twoFactor.SendAction] is missing a field annotated with @JSONResponse. This is used to figure out what to send back in the response.
    at org.primeframework.mvc.action.result.JSONResult.execute(JSONResult.java:101)
    at org.primeframework.mvc.action.result.JSONResult.execute(JSONResult.java:55)
    at org.primeframework.mvc.action.result.DefaultResultInvocationWorkflow.perform(DefaultResultInvocationWorkflow.java:105)
    at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
    at org.primeframework.mvc.scope.DefaultScopeStorageWorkflow.perform(DefaultScopeStorageWorkflow.java:60)
    at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
...