Merge pull request #4081 from stianst/KEYCLOAK-4785
KEYCLOAK-4785 Use realm name when creating admin console base url
This commit is contained in:
commit
2913ee8e23
2 changed files with 49 additions and 49 deletions
|
@ -35,32 +35,32 @@ import java.net.URI;
|
||||||
*/
|
*/
|
||||||
public class Urls {
|
public class Urls {
|
||||||
|
|
||||||
public static URI adminConsoleRoot(URI baseUri, String realmId) {
|
public static URI adminConsoleRoot(URI baseUri, String realmName) {
|
||||||
return UriBuilder.fromUri(baseUri).path(AdminRoot.class).path("{realm}/console/").build(realmId);
|
return UriBuilder.fromUri(baseUri).path(AdminRoot.class).path("{realm}/console/").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountApplicationsPage(URI baseUri, String realmId) {
|
public static URI accountApplicationsPage(URI baseUri, String realmName) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "applicationsPage").build(realmId);
|
return accountBase(baseUri).path(AccountService.class, "applicationsPage").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UriBuilder accountBase(URI baseUri) {
|
public static UriBuilder accountBase(URI baseUri) {
|
||||||
return realmBase(baseUri).path(RealmsResource.class, "getAccountService");
|
return realmBase(baseUri).path(RealmsResource.class, "getAccountService");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountPage(URI baseUri, String realmId) {
|
public static URI accountPage(URI baseUri, String realmName) {
|
||||||
return accountPageBuilder(baseUri).build(realmId);
|
return accountPageBuilder(baseUri).build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UriBuilder accountPageBuilder(URI baseUri) {
|
public static UriBuilder accountPageBuilder(URI baseUri) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "accountPage");
|
return accountBase(baseUri).path(AccountService.class, "accountPage");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountPasswordPage(URI baseUri, String realmId) {
|
public static URI accountPasswordPage(URI baseUri, String realmName) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "passwordPage").build(realmId);
|
return accountBase(baseUri).path(AccountService.class, "passwordPage").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountFederatedIdentityPage(URI baseUri, String realmId) {
|
public static URI accountFederatedIdentityPage(URI baseUri, String realmName) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "federatedIdentityPage").build(realmId);
|
return accountBase(baseUri).path(AccountService.class, "federatedIdentityPage").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountFederatedIdentityUpdate(URI baseUri, String realmName) {
|
public static URI accountFederatedIdentityUpdate(URI baseUri, String realmName) {
|
||||||
|
@ -116,45 +116,45 @@ public class Urls {
|
||||||
.build(realmName);
|
.build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountTotpPage(URI baseUri, String realmId) {
|
public static URI accountTotpPage(URI baseUri, String realmName) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "totpPage").build(realmId);
|
return accountBase(baseUri).path(AccountService.class, "totpPage").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountTotpRemove(URI baseUri, String realmId, String stateChecker) {
|
public static URI accountTotpRemove(URI baseUri, String realmName, String stateChecker) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "processTotpRemove")
|
return accountBase(baseUri).path(AccountService.class, "processTotpRemove")
|
||||||
.queryParam("stateChecker", stateChecker)
|
.queryParam("stateChecker", stateChecker)
|
||||||
.build(realmId);
|
.build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountLogPage(URI baseUri, String realmId) {
|
public static URI accountLogPage(URI baseUri, String realmName) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "logPage").build(realmId);
|
return accountBase(baseUri).path(AccountService.class, "logPage").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountSessionsPage(URI baseUri, String realmId) {
|
public static URI accountSessionsPage(URI baseUri, String realmName) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "sessionsPage").build(realmId);
|
return accountBase(baseUri).path(AccountService.class, "sessionsPage").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountSessionsLogoutPage(URI baseUri, String realmId, String stateChecker) {
|
public static URI accountSessionsLogoutPage(URI baseUri, String realmName, String stateChecker) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "processSessionsLogout")
|
return accountBase(baseUri).path(AccountService.class, "processSessionsLogout")
|
||||||
.queryParam("stateChecker", stateChecker)
|
.queryParam("stateChecker", stateChecker)
|
||||||
.build(realmId);
|
.build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountRevokeClientPage(URI baseUri, String realmId) {
|
public static URI accountRevokeClientPage(URI baseUri, String realmName) {
|
||||||
return accountBase(baseUri).path(AccountService.class, "processRevokeGrant")
|
return accountBase(baseUri).path(AccountService.class, "processRevokeGrant")
|
||||||
.build(realmId);
|
.build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI accountLogout(URI baseUri, URI redirectUri, String realmId) {
|
public static URI accountLogout(URI baseUri, URI redirectUri, String realmName) {
|
||||||
return realmLogout(baseUri).queryParam("redirect_uri", redirectUri).build(realmId);
|
return realmLogout(baseUri).queryParam("redirect_uri", redirectUri).build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI loginActionUpdatePassword(URI baseUri, String realmId) {
|
public static URI loginActionUpdatePassword(URI baseUri, String realmName) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "updatePassword").build(realmId);
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "updatePassword").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI loginActionUpdateTotp(URI baseUri, String realmId) {
|
public static URI loginActionUpdateTotp(URI baseUri, String realmName) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "updateTotp").build(realmId);
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "updateTotp").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UriBuilder requiredActionBase(URI baseUri) {
|
public static UriBuilder requiredActionBase(URI baseUri) {
|
||||||
|
@ -162,20 +162,20 @@ public class Urls {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static URI loginActionUpdateProfile(URI baseUri, String realmId) {
|
public static URI loginActionUpdateProfile(URI baseUri, String realmName) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "updateProfile").build(realmId);
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "updateProfile").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI loginActionEmailVerification(URI baseUri, String realmId) {
|
public static URI loginActionEmailVerification(URI baseUri, String realmName) {
|
||||||
return loginActionEmailVerificationBuilder(baseUri).build(realmId);
|
return loginActionEmailVerificationBuilder(baseUri).build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UriBuilder loginActionEmailVerificationBuilder(URI baseUri) {
|
public static UriBuilder loginActionEmailVerificationBuilder(URI baseUri) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "emailVerification");
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "emailVerification");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI loginResetCredentials(URI baseUri, String realmId) {
|
public static URI loginResetCredentials(URI baseUri, String realmName) {
|
||||||
return loginResetCredentialsBuilder(baseUri).build(realmId);
|
return loginResetCredentialsBuilder(baseUri).build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UriBuilder executeActionsBuilder(URI baseUri) {
|
public static UriBuilder executeActionsBuilder(URI baseUri) {
|
||||||
|
@ -186,44 +186,44 @@ public class Urls {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.RESET_CREDENTIALS_PATH);
|
return loginActionsBase(baseUri).path(LoginActionsService.RESET_CREDENTIALS_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI loginUsernameReminder(URI baseUri, String realmId) {
|
public static URI loginUsernameReminder(URI baseUri, String realmName) {
|
||||||
return loginUsernameReminderBuilder(baseUri).build(realmId);
|
return loginUsernameReminderBuilder(baseUri).build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UriBuilder loginUsernameReminderBuilder(URI baseUri) {
|
public static UriBuilder loginUsernameReminderBuilder(URI baseUri) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "usernameReminder");
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "usernameReminder");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String realmIssuer(URI baseUri, String realmId) {
|
public static String realmIssuer(URI baseUri, String realmName) {
|
||||||
return realmBase(baseUri).path("{realm}").build(realmId).toString();
|
return realmBase(baseUri).path("{realm}").build(realmName).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UriBuilder realmBase(URI baseUri) {
|
public static UriBuilder realmBase(URI baseUri) {
|
||||||
return UriBuilder.fromUri(baseUri).path(RealmsResource.class);
|
return UriBuilder.fromUri(baseUri).path(RealmsResource.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI realmLoginPage(URI baseUri, String realmId) {
|
public static URI realmLoginPage(URI baseUri, String realmName) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "authenticate").build(realmId);
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "authenticate").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static UriBuilder realmLogout(URI baseUri) {
|
private static UriBuilder realmLogout(URI baseUri) {
|
||||||
return tokenBase(baseUri).path(OIDCLoginProtocolService.class, "logout");
|
return tokenBase(baseUri).path(OIDCLoginProtocolService.class, "logout");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI realmRegisterAction(URI baseUri, String realmId) {
|
public static URI realmRegisterAction(URI baseUri, String realmName) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "processRegister").build(realmId);
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "processRegister").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI realmRegisterPage(URI baseUri, String realmId) {
|
public static URI realmRegisterPage(URI baseUri, String realmName) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "registerPage").build(realmId);
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "registerPage").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI realmInstalledAppUrnCallback(URI baseUri, String realmId) {
|
public static URI realmInstalledAppUrnCallback(URI baseUri, String realmName) {
|
||||||
return tokenBase(baseUri).path(OIDCLoginProtocolService.class, "installedAppUrnCallback").build(realmId);
|
return tokenBase(baseUri).path(OIDCLoginProtocolService.class, "installedAppUrnCallback").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI realmOauthAction(URI baseUri, String realmId) {
|
public static URI realmOauthAction(URI baseUri, String realmName) {
|
||||||
return loginActionsBase(baseUri).path(LoginActionsService.class, "processConsent").build(realmId);
|
return loginActionsBase(baseUri).path(LoginActionsService.class, "processConsent").build(realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI firstBrokerLoginProcessor(URI baseUri, String realmName) {
|
public static URI firstBrokerLoginProcessor(URI baseUri, String realmName) {
|
||||||
|
|
|
@ -296,7 +296,7 @@ public class AdminConsole {
|
||||||
authUrl = authUrl.substring(0, authUrl.length() - 1);
|
authUrl = authUrl.substring(0, authUrl.length() - 1);
|
||||||
|
|
||||||
map.put("authUrl", authUrl);
|
map.put("authUrl", authUrl);
|
||||||
map.put("consoleBaseUrl", Urls.adminConsoleRoot(baseUri, realm.getId()));
|
map.put("consoleBaseUrl", Urls.adminConsoleRoot(baseUri, realm.getName()));
|
||||||
map.put("resourceUrl", Urls.themeRoot(baseUri) + "/admin/" + theme.getName());
|
map.put("resourceUrl", Urls.themeRoot(baseUri) + "/admin/" + theme.getName());
|
||||||
map.put("masterRealm", Config.getAdminRealm());
|
map.put("masterRealm", Config.getAdminRealm());
|
||||||
map.put("resourceVersion", Version.RESOURCES_VERSION);
|
map.put("resourceVersion", Version.RESOURCES_VERSION);
|
||||||
|
|
Loading…
Reference in a new issue