本文整理匯總了Java中org.keycloak.constants.ServiceUrlConstants類的典型用法代碼示例。如果您正苦於以下問題:Java ServiceUrlConstants類的具體用法?Java ServiceUrlConstants怎麽用?Java ServiceUrlConstants使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ServiceUrlConstants類屬於org.keycloak.constants包,在下文中一共展示了ServiceUrlConstants類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAccountUri
import org.keycloak.constants.ServiceUrlConstants; //導入依賴的package包/類
public String getAccountUri(HttpServletRequest req) {
KeycloakSecurityContext session = getSession(req);
String baseUrl = getAuthServerBaseUrl(req);
String realm = session.getRealm();
return KeycloakUriBuilder.fromUri(baseUrl).path(ServiceUrlConstants.ACCOUNT_SERVICE_PATH)
.queryParam("referrer", "app-jsp")
.queryParam("referrer_uri", getReferrerUri(req)).build(realm).toString();
}
示例2: handleCustomersRequest
import org.keycloak.constants.ServiceUrlConstants; //導入依賴的package包/類
@RequestMapping(value = "/products", method = RequestMethod.GET)
public String handleCustomersRequest(Principal principal, Model model) {
model.addAttribute("products", productService.getProducts());
model.addAttribute("principal", principal);
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8180/auth").path(ServiceUrlConstants.TOKEN_SERVICE_LOGOUT_PATH)
.queryParam("redirect_uri", "http://localhost:8080/products").build("quickstart").toString();
model.addAttribute("logout", logoutUri);
return "products";
}
示例3: getAccountUri
import org.keycloak.constants.ServiceUrlConstants; //導入依賴的package包/類
public String getAccountUri(HttpServletRequest req) {
KeycloakSecurityContext session = getSession(req);
String baseUrl = getAuthServerBaseUrl(req);
String realm = session.getRealm();
return KeycloakUriBuilder.fromUri(baseUrl).path(ServiceUrlConstants.ACCOUNT_SERVICE_PATH)
.queryParam("referrer", "app-profile-jsp")
.queryParam("referrer_uri", getReferrerUri(req)).build(realm).toString();
}
示例4: getAccountURI
import org.keycloak.constants.ServiceUrlConstants; //導入依賴的package包/類
@Override
public String getAccountURI(HttpServletRequest req) {
KeycloakSecurityContext session = getSession(req);
String baseUrl = getAuthServerBaseUrl(req);
String realm = session.getRealm();
return KeycloakUriBuilder.fromUri(baseUrl).path(ServiceUrlConstants.ACCOUNT_SERVICE_PATH)
.queryParam("referrer", "relax-dms").build(realm).toString();
}
示例5: getAccountUri
import org.keycloak.constants.ServiceUrlConstants; //導入依賴的package包/類
public String getAccountUri(HttpServletRequest req) {
String serverPath = findKeycloakServerPath(req);
String realm = findRealmName(req);
return KeycloakUriBuilder.fromUri(serverPath).path(ServiceUrlConstants.ACCOUNT_SERVICE_PATH)
.queryParam("referrer", "app-profile-saml").build(realm).toString();
}