keycloak-service
公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.keycloak.url.FixedHostnameProvider クラス
org.keycloak.url.FixedHostnameProvider の継承関係図
Inheritance graph
org.keycloak.url.FixedHostnameProvider 連携図
Collaboration graph

公開メンバ関数

 FixedHostnameProvider (KeycloakSession session, String globalHostname, int httpPort, int httpsPort)
 
String getHostname (UriInfo originalUriInfo)
 
int getPort (UriInfo originalUriInfo)
 

非公開変数類

final KeycloakSession session
 
final String globalHostname
 
final int httpPort
 
final int httpsPort
 

詳解

構築子と解体子

◆ FixedHostnameProvider()

org.keycloak.url.FixedHostnameProvider.FixedHostnameProvider ( KeycloakSession  session,
String  globalHostname,
int  httpPort,
int  httpsPort 
)
inline
16  {
17  this.session = session;
19  this.httpPort = httpPort;
20  this.httpsPort = httpsPort;
21  }
final int httpPort
Definition: FixedHostnameProvider.java:13
final String globalHostname
Definition: FixedHostnameProvider.java:12
final KeycloakSession session
Definition: FixedHostnameProvider.java:11
final int httpsPort
Definition: FixedHostnameProvider.java:14

関数詳解

◆ getHostname()

String org.keycloak.url.FixedHostnameProvider.getHostname ( UriInfo  originalUriInfo)
inline
24  {
25  RealmModel realm = session.getContext().getRealm();
26  if (realm != null) {
27  String realmHostname = session.getContext().getRealm().getAttribute("hostname");
28  if (realmHostname != null && !realmHostname.isEmpty()) {
29  return realmHostname;
30  }
31  }
32  return this.globalHostname;
33  }
final String globalHostname
Definition: FixedHostnameProvider.java:12
final KeycloakSession session
Definition: FixedHostnameProvider.java:11

◆ getPort()

int org.keycloak.url.FixedHostnameProvider.getPort ( UriInfo  originalUriInfo)
inline
36  {
37  boolean https = originalUriInfo.getRequestUri().getScheme().equals("https");
38  if (https) {
39  if (httpsPort == -1) {
40  return originalUriInfo.getRequestUri().getPort();
41  } else if (httpsPort == 443) {
42  return -1;
43  } else {
44  return httpsPort;
45  }
46  } else {
47  if (httpPort == -1) {
48  return originalUriInfo.getRequestUri().getPort();
49  } else if (httpPort == 80) {
50  return -1;
51  } else {
52  return httpPort;
53  }
54  }
55  }
final int httpPort
Definition: FixedHostnameProvider.java:13
final int httpsPort
Definition: FixedHostnameProvider.java:14

メンバ詳解

◆ globalHostname

final String org.keycloak.url.FixedHostnameProvider.globalHostname
private

◆ httpPort

final int org.keycloak.url.FixedHostnameProvider.httpPort
private

◆ httpsPort

final int org.keycloak.url.FixedHostnameProvider.httpsPort
private

◆ session

final KeycloakSession org.keycloak.url.FixedHostnameProvider.session
private

このクラス詳解は次のファイルから抽出されました: