You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by Lionel SCHWARZ <li...@in2p3.fr> on 2024/10/24 14:42:20 UTC

WS returning HTTP scheme in Location header

Hi all,
On my Syncope 3.0.8 install, built from Maven, running inside Tomcat and served by a HTTPS server, 

when I send a

POST https://myhost/syncope/rest/users

I get a response but with a header:
location: http://myhost/syncope/rest/users/...

with scheme "http" instead of "https".

The same happens with "next" and "prev" URL retrieved when using pagination on a GET request

Is there something misconfigured in my project?


Regards
Lionel

Re: WS returning HTTP scheme in Location header

Posted by Lionel SCHWARZ <li...@in2p3.fr>.
----- Le 25 Oct 24, à 8:25, Francesco Chicchiriccò <il...@apache.org> a écrit : 

> On 24/10/24 16:42, Lionel SCHWARZ wrote:

>> Hi all,
>> On my Syncope 3.0.8 install, built from Maven, running inside Tomcat and served
>> by a HTTPS server,

>> when I send a

>> POST [ https://myhost/syncope/rest/users | https://myhost/syncope/rest/users ] I
>> get a response but with a header:
>> location: [ http://myhost/syncope/rest/users/ |
>> http://myhost/syncope/rest/users/ ] ...

>> with scheme "http" instead of "https".

>> The same happens with "next" and "prev" URL retrieved when using pagination on a
>> GET request

>> Is there something misconfigured in my project?

> Hi Lionel,
> not in your project, but in your deployment: you need to make Tomcat aware of
> the fact it sits behind an HTTPS reverse proxy.

> Just google around and you'll find how to do that, for example: [1]

> FTR, this is not needed when you run Syncope components as standalone via Spring
> Boot's Java EE container.

> Regards.

> [1] [
> https://serverfault.com/questions/842055/reverse-proxy-from-apache-to-tomcat-for-https-to-http
> |
> https://serverfault.com/questions/842055/reverse-proxy-from-apache-to-tomcat-for-https-to-http
> ]

Thanks Francesco, I will have a look at this 

Regards 
Lionel 

Re: WS returning HTTP scheme in Location header

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 24/10/24 16:42, Lionel SCHWARZ wrote:
> Hi all,
> On my Syncope 3.0.8 install, built from Maven, running inside Tomcat and served by a HTTPS server,
>
> when I send a
>
> POSThttps://myhost/syncope/rest/users
>
> I get a response but with a header:
> location:http://myhost/syncope/rest/users/...
>
> with scheme "http" instead of "https".
>
> The same happens with "next" and "prev" URL retrieved when using pagination on a GET request
>
> Is there something misconfigured in my project?

Hi Lionel,
not in your project, but in your deployment: you need to make Tomcat aware of the fact it sits behind an HTTPS reverse proxy.

Just google around and you'll find how to do that, for example: [1]

FTR, this is not needed when you run Syncope components as standalone via Spring Boot's Java EE container.

Regards.

[1] https://serverfault.com/questions/842055/reverse-proxy-from-apache-to-tomcat-for-https-to-http

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/