/** * Return URL to Password change GUI for selected namespace * * @param namespace namespace where we want to reset password * @return URL to password reset GUI */ public static String getPasswordResetLink(String namespace) { String value = PerunWebSession.getInstance().getConfiguration().getCustomProperty("getPasswordResetUrl"); if (value != null && !value.isEmpty()) { // PWD-RESET URL IS CONFIGURED AS FIXED if (namespace != null && !namespace.isEmpty()) { return value + "?login-namespace=" + namespace; } else { return value; } } else { // USE RELATIVE PWD-RESET URL String baseUrl = Window.Location.getProtocol() + "//" + Window.Location.getHost(); if (!Utils.isDevel()) { // VALID URL FOR PRODUCTION String rpc = ""; if (PerunWebSession.getInstance().getRpcServer() != null) { rpc = PerunWebSession.getInstance().getRpcServer(); } if (rpc.equalsIgnoreCase("krb")) { baseUrl += "/krb"; } else if (rpc.equalsIgnoreCase("fed")) { baseUrl += "/fed"; } else if (rpc.equalsIgnoreCase("forceAuthn-fed")) { baseUrl += "/fed-force"; } else if (rpc.equalsIgnoreCase("cert")) { baseUrl += "/cert"; } else if (rpc.equalsIgnoreCase("einfra")) { baseUrl += "/krb-einfra"; } else { // KRB AS BACKUP - "default" baseUrl += "/krb"; } baseUrl += "/pwd-reset/"; } else { // VALID URL FOR DEVEL baseUrl += "/PasswordResetKrb.html"; } if (namespace != null && !namespace.isEmpty()) { return baseUrl + "?login-namespace=" + namespace; } else { return baseUrl; } } }