KEYCLOAK-3364 Fix for dns that ends with digit
This commit is contained in:
parent
f2f508ac2e
commit
ffce2023c0
1 changed files with 6 additions and 8 deletions
|
@ -18,6 +18,7 @@
|
||||||
package org.keycloak.protocol.oidc.utils;
|
package org.keycloak.protocol.oidc.utils;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
import org.keycloak.common.util.UriUtils;
|
||||||
import org.keycloak.models.ClientModel;
|
import org.keycloak.models.ClientModel;
|
||||||
import org.keycloak.models.Constants;
|
import org.keycloak.models.Constants;
|
||||||
import org.keycloak.models.RealmModel;
|
import org.keycloak.models.RealmModel;
|
||||||
|
@ -121,15 +122,12 @@ public class RedirectUtils {
|
||||||
|
|
||||||
private static String relativeToAbsoluteURI(UriInfo uriInfo, String rootUrl, String relative) {
|
private static String relativeToAbsoluteURI(UriInfo uriInfo, String rootUrl, String relative) {
|
||||||
if (rootUrl == null || rootUrl.isEmpty()) {
|
if (rootUrl == null || rootUrl.isEmpty()) {
|
||||||
URI baseUri = uriInfo.getBaseUri();
|
rootUrl = UriUtils.getOrigin(uriInfo.getBaseUri());
|
||||||
String uri = baseUri.getScheme() + "://" + baseUri.getHost();
|
|
||||||
if (baseUri.getPort() != -1) {
|
|
||||||
uri += ":" + baseUri.getPort();
|
|
||||||
}
|
}
|
||||||
rootUrl = uri;
|
StringBuilder sb = new StringBuilder();
|
||||||
}
|
sb.append(rootUrl);
|
||||||
relative = rootUrl + relative;
|
sb.append(relative);
|
||||||
return relative;
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean matchesRedirects(Set<String> validRedirects, String redirect) {
|
private static boolean matchesRedirects(Set<String> validRedirects, String redirect) {
|
||||||
|
|
Loading…
Reference in a new issue