Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.wso2.carbon.identity.application.mgt.ApplicationManagementService;
import org.wso2.carbon.identity.central.log.mgt.utils.LogConstants;
import org.wso2.carbon.identity.central.log.mgt.utils.LoggerUtils;
import org.wso2.carbon.identity.core.ServiceURL;
import org.wso2.carbon.identity.core.ServiceURLBuilder;
import org.wso2.carbon.identity.core.URLBuilderException;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
Expand Down Expand Up @@ -180,6 +181,7 @@ public class EndpointUtil {
private static final String UNKNOWN_ERROR = "unknown_error";
private static final String ALLOW_ADDITIONAL_PARAMS_FROM_ERROR_URL = "OAuth.AllowAdditionalParamsFromErrorUrl";
private static final String KEEP_OIDC_SCOPES_IN_CONSENT_URL = "OAuth.KeepOIDCScopesInConsentURL";
private static final String USE_ABSOLUTE_PUBLIC_URL_FOR_AUTH_REQUEST = "OAuth.UseAbsolutePublicURLForAuthRequest";
private static final String IDP_ENTITY_ID = "IdPEntityId";
private static Class<? extends OAuthAuthzRequest> oAuthAuthzRequestClass;

Expand Down Expand Up @@ -592,9 +594,13 @@ private static AuthenticationRequestCacheEntry buildAuthenticationRequestCacheEn

int tenantId = OAuth2Util.getClientTenatId();

//Build the authentication request context.
String commonAuthCallerPath =
ServiceURLBuilder.create().addPath(OAUTH2_AUTHORIZE).build().getRelativeInternalURL();
// Build the authentication request context.
boolean useAbsolutePublicURLForAuthRequest = Boolean.parseBoolean(IdentityUtil.getProperty(
USE_ABSOLUTE_PUBLIC_URL_FOR_AUTH_REQUEST));
ServiceURL urlBuilder = ServiceURLBuilder.create().addPath(OAUTH2_AUTHORIZE).build();
String commonAuthCallerPath = useAbsolutePublicURLForAuthRequest ? urlBuilder.getAbsolutePublicURL() :
urlBuilder.getRelativeInternalURL();

authenticationRequest.setCommonAuthCallerPath(commonAuthCallerPath);
authenticationRequest.setForceAuth(forceAuthenticate);
authenticationRequest.setPassiveAuth(checkAuthentication);
Expand Down