Source:
public IOpResponse execute(GetAuthorizationUrlParams params) throws Exception { final Rp site = getRp(); String authorizationEndpoint = getDiscoveryService().getConnectDiscoveryResponse(site).getAuthorizationEndpoint(); List<String> scope = Lists.newArrayList(); if (params.getScope() != null && !params.getScope().isEmpty()) { scope.addAll(params.getScope()); } else if (site.getScope() != null) { scope.addAll(site.getScope()); } if (Utils.hasAuthorizationRedirectUri(site.getRedirectUris(), params.getAuthorizationRedirectUri())) { LOG.info("Updating authorization redirect uri: " + params.getAuthorizationRedirectUri()); site.setAuthorizationRedirectUri(params.getAuthorizationRedirectUri()); persistRp(site); } authorizationEndpoint += "?response_type=" + Utils.joinAndUrlEncode(site.getResponseTypes()); authorizationEndpoint += "&client_id=" + site.getClientId(); authorizationEndpoint += "&redirect_uri=" + site.getAuthorizationRedirectUri(); authorizationEndpoint += "&scope=" + Utils.joinAndUrlEncode(scope); authorizationEndpoint += "&state=" + getStateService().generateState(); authorizationEndpoint += "&nonce=" + getStateService().generateNonce(); String acrValues = Utils.joinAndUrlEncode(acrValues(site, params)).trim(); if (!Strings.isNullOrEmpty(acrValues)) { authorizationEndpoint += "&acr_values=" + acrValues; } if (!Strings.isNullOrEmpty(params.getPrompt())) { authorizationEndpoint += "&prompt=" + params.getPrompt(); } if (!Strings.isNullOrEmpty(params.getHostedDomain())) { authorizationEndpoint += "&hd=" + params.getHostedDomain(); } if (params.getCustomParameters() != null && !params.getCustomParameters().isEmpty()) { authorizationEndpoint += "&" + AuthorizeRequestParam.CUSTOM_RESPONSE_HEADERS + "=" + Utils.encode(Util.mapAsString(params.getCustomParameters())); } return new GetAuthorizationUrlResponse(authorizationEndpoint); }

Target:
public IOpResponse execute(GetAuthorizationUrlParams params) throws Exception { final Rp site = getRp(); String authorizationEndpoint = getDiscoveryService().getConnectDiscoveryResponse(site).getAuthorizationEndpoint(); List<String> scope = Lists.newArrayList(); if (params.getScope() != null && !params.getScope().isEmpty()) { scope.addAll(params.getScope()); } else if (site.getScope() != null) { scope.addAll(site.getScope()); } if (StringUtils.isNotBlank(params.getAuthorizationRedirectUri()) && !site.getRedirectUris().contains(params.getAuthorizationRedirectUri())) { throw new HttpException(ErrorResponseCode.REDIRECT_URI_IS_NOT_REGISTERED); } String redirectUri = StringUtils.isNotBlank(params.getAuthorizationRedirectUri()) ? params.getAuthorizationRedirectUri() : site.getAuthorizationRedirectUri(); authorizationEndpoint += "?response_type=" + Utils.joinAndUrlEncode(site.getResponseTypes()); authorizationEndpoint += "&client_id=" + site.getClientId(); authorizationEndpoint += "&redirect_uri=" + redirectUri; authorizationEndpoint += "&scope=" + Utils.joinAndUrlEncode(scope); authorizationEndpoint += "&state=" + getStateService().generateState(); authorizationEndpoint += "&nonce=" + getStateService().generateNonce(); String acrValues = Utils.joinAndUrlEncode(acrValues(site, params)).trim(); if (!Strings.isNullOrEmpty(acrValues)) { authorizationEndpoint += "&acr_values=" + acrValues; } if (!Strings.isNullOrEmpty(params.getPrompt())) { authorizationEndpoint += "&prompt=" + params.getPrompt(); } if (!Strings.isNullOrEmpty(params.getHostedDomain())) { authorizationEndpoint += "&hd=" + params.getHostedDomain(); } if (params.getCustomParameters() != null && !params.getCustomParameters().isEmpty()) { authorizationEndpoint += "&" + AuthorizeRequestParam.CUSTOM_RESPONSE_HEADERS + "=" + Utils.encode(Util.mapAsString(params.getCustomParameters())); } return new GetAuthorizationUrlResponse(authorizationEndpoint); }