Open mghildiy opened 5 years ago
Please provide more details about how you have configured Charon. What is the destination hostname? Probably your destination server does not provide an error page on /error/403 url, that's why you are getting 404 error.
Can you provide some links on how to configure Charon? Currently I don't see any Charon specific configuration in the application.
Just check out the readme file
So I studied my application a bit more. Here is the situation:
I have some LDAP based user validations. If validation is successful, I redirect the request to another server whose response then I intercept using ReceivedResponseInterceptor and perform some actions of my own. MappingsProvider is extended for it. It works fine.
But if LDAP validations fails, I simply need to display error html page which resides in current server, ie no redirection to another server. To do this I have done what I posted in my original post. So my understanding is that no mappings are needed for it. But it doesn't work.
I see your problem now.
The ForwardedRequestInterceptor
is invoked to late, after the mapping is already chosen.
Currently the only way you can achieve your goal is to implement ReceivedResponseInterceptor
and change the response to HTTP 301 with Location header set to"/error/403"
.
Is that solution enough for you?
In my maven application, I have implemented ForwardedRequestInterceptor.intercept() as:
requestData.setUri("error/403");
403.html is location at:
Instead of 403.html, I get following:
How to ensure that 403.html is displayed?