diff --git a/modules/dxp/apps/saml/saml-hook/docroot/META-INF/custom_jsps/html/portal/saml/select_idp.jsp b/modules/dxp/apps/saml/saml-hook/docroot/META-INF/custom_jsps/html/portal/saml/select_idp.jsp
index 5baee4a2647675fb510e798a3a22f18da3d46d32..1ca261126b4290e53851754031743a2e276ee347 100644
--- a/modules/dxp/apps/saml/saml-hook/docroot/META-INF/custom_jsps/html/portal/saml/select_idp.jsp
+++ b/modules/dxp/apps/saml/saml-hook/docroot/META-INF/custom_jsps/html/portal/saml/select_idp.jsp
@@ -29,7 +29,22 @@ JSONArray relevantIdpConnectionsJSONArray = samlSsoLoginContext.getJSONArray("re
 	<aui:input name="redirect" type="hidden" value="<%= redirect %>" />
 
 	<c:choose>
-		<c:when test="<%= relevantIdpConnectionsJSONArray.length() > 0 %>">
+		<c:when test="<%= relevantIdpConnectionsJSONArray.length() == 1 %>">
+			<p><liferay-ui:message key="redirecting-to-your-identity-provider" /></p>
+
+			<%
+			JSONObject relevantIdpConnectionJSONObject = relevantIdpConnectionsJSONArray.getJSONObject(0);
+			%>
+
+			<aui:input name="idpEntityId" type="hidden" value='<%= HtmlUtil.escapeAttribute(relevantIdpConnectionJSONObject.getString("entityId")) %>' />
+
+			<aui:script sandbox="<%= true %>">
+				window.addEventListener("load", (event) => {
+					window.fm.submit();
+				});
+			</aui:script>
+		</c:when>
+		<c:when test="<%= relevantIdpConnectionsJSONArray.length() > 1 %>">
 			<p><liferay-ui:message key="please-select-your-identity-provider" /></p>
 
 			<aui:select label="identity-provider" name="idpEntityId">
@@ -60,4 +75,18 @@ JSONArray relevantIdpConnectionsJSONArray = samlSsoLoginContext.getJSONArray("re
 			<liferay-ui:message key="no-identity-provider-is-available-to-sign-you-in" />
 		</c:otherwise>
 	</c:choose>
-</aui:form>
\ No newline at end of file
+</aui:form>
+
+<c:if test="<%= Validator.isNotNull(redirect) %>">
+	<aui:script sandbox="<%= true %>">
+		var form = document.getElementById('<portlet:namespace />fm');
+
+		var redirect = form.querySelector('#<portlet:namespace />redirect');
+
+		if (redirect) {
+			var redirectVal = redirect.getAttribute('value');
+
+			redirect.setAttribute('value', redirectVal + window.location.hash);
+		}
+	</aui:script>
+</c:if>
\ No newline at end of file