Callback url results in error "The redirect URI is wrong. You sent http..."

Problem statement

When using the Maven mvc-auth-commons SDK the following error is returned when using the SDK behind a reverse proxy:

"com.auth0.exception.APIException: Request failed with status code 403: **The redirect URI is wrong. You sent [http://domain1](http://domain1/), and we expected [https://domain2](https://domain2/)** at com.auth0.net.ExtendedBaseRequest.createResponseException(ExtendedBaseRequest.java:131) ~[auth0-1.44.1.jar:1.44.1] "

Cause

The SDK cannot be used behind a reverse proxy that is not configured with end-to-end encryption. Auth0 expects a connection secured by SSL encryption, and the proxy returns an HTTP URL.

Solution

Ensure any proxy used in the connection is configured with end-to-end SSL Encryption.

Related Resources: