API HTTP server errors with Azure AD B2C

Image: “HTTP error codes”

Have a read of this post first.

Notice how a managed HTTP 409 API error is displayed on the user’s screen.

But what happens if the API returns a HTTP server error?

You can configure HTTP errors in Beeceptor.

Image showing Beeceptor configured to retrun HTTP 403.

Returning an HTTP 403 error (Forbidden) displays:

Image showing error: Basic credentials specified for ‘REST-TestAPI’ are invalid. Check that the credentials are correct and that access has been granted by the resource.

Returning an HTTP 500 error (Internal Server Error) displays:

Image showing error: The claims exchange ‘REST-TestAPI’ specified in step ‘1’ returned HTTP error response with Code ‘InternalServerError’ and Reason ‘Internal Server Error’.

Returning an HTTP 501 error (Not implemented) displays:

Image showing error: The claims exchange ‘REST-TestAPI’ specified in step ‘1’ returned HTTP error response with Code ‘NotImplemented’ and Reason ‘Not Implemented’.

And so on.

You can customise these errors to some extent.

All good!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rory Braybrook

Rory Braybrook

NZ Microsoft Identity dude and MVP. Azure AD/B2C/ADFS/Auth0/identityserver. StackOverflow: https://bit.ly/2XU4yvJ Presentations: http://bit.ly/334ZPt5