Legacy Knowledge Base
Published Jul. 2, 2025

When authorizing OAuth2 applications HTTP is used instead of HTTPS

Written By

Péter Simonyi

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • If there's a web server in front of Liferay, when clicking on the Authorize button to authorize OAuth2 applications HTTP is used instead of HTTPS and the following WARNs are displayed in the log.
2019-11-08 09:37:05.000 WARN [http-nio-8080-exec-63][AbstractOAuthService:88] Unsecure HTTP, Transport Layer Security is recommended
2019-11-08 09:37:05.001 WARN [http-nio-8080-exec-63][WebApplicationExceptionMapper:88] javax.ws.rs.BadRequestException: HTTP 400 Bad Request_
at org.apache.cxf.jaxrs.utils.SpecExceptions.toBadRequestException(SpecExceptions.java:84)_
at org.apache.cxf.jaxrs.utils.ExceptionUtils.toBadRequestException(ExceptionUtils.java:119)_
at org.apache.cxf.rs.security.oauth2.services.RedirectionBasedGrantService.completeAuthorization(RedirectionBasedGrantService.java:356)_
at org.apache.cxf.rs.security.oauth2.services.RedirectionBasedGrantService.authorizeDecisionForm(RedirectionBasedGrantService.java:117)_

Environment

  • Liferay DXP 7.1

Resolution

  • Set the web.server.forwarded.protocol.enabled property to true in your portal-ext.properties file.

Additional Information

Please see the descriptions of the web.server.forwarded.protocol.enabled and web.server.forwarded.protocol.header properties.

#
# Set this to true to use the property "web.server.forward.protocol.header"
# to get the protocol. The property "web.server.protocol" must not have been
# overriden.
#
# Env: LIFERAY_WEB_PERIOD_SERVER_PERIOD_FORWARDED_PERIOD_PROTOCOL_PERIOD_ENABLED
#
web.server.forwarded.protocol.enabled=false

#
# Set the HTTP header to use to get the protocol. The property
# "web.server.forwarded.protocol.enabled" must be set to true.
#
# Env: LIFERAY_WEB_PERIOD_SERVER_PERIOD_FORWARDED_PERIOD_PROTOCOL_PERIOD_HEADER
#
web.server.forwarded.protocol.header=X-Forwarded-Proto

Did this article resolve your issue ?

Legacy Knowledge Base