keycloak-service
公開メンバ関数 | 静的公開メンバ関数 | 全メンバ一覧
org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation クラス
org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation の継承関係図
Inheritance graph
org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation 連携図
Collaboration graph

公開メンバ関数

Response generateInstallation (KeycloakSession session, RealmModel realm, ClientModel client, URI baseUri)
 
String getProtocol ()
 
String getDisplayType ()
 
String getHelpText ()
 
String getFilename ()
 
String getMediaType ()
 
boolean isDownloadOnly ()
 
void close ()
 
ClientInstallationProvider create (KeycloakSession session)
 
void init (Config.Scope config)
 
void postInit (KeycloakSessionFactory factory)
 
String getId ()
 

静的公開メンバ関数

static void baseXml (KeycloakSession session, RealmModel realm, ClientModel client, URI baseUri, SamlClient samlClient, StringBuilder buffer)
 

詳解

著者
Bill Burke
バージョン
Revision
1

関数詳解

◆ baseXml()

static void org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.baseXml ( KeycloakSession  session,
RealmModel  realm,
ClientModel  client,
URI  baseUri,
SamlClient  samlClient,
StringBuilder  buffer 
)
inlinestatic
51  {
52  buffer.append(" <SP entityID=\"").append(client.getClientId()).append("\"\n");
53  buffer.append(" sslPolicy=\"").append(realm.getSslRequired().name()).append("\"\n");
54  buffer.append(" logoutPage=\"SPECIFY YOUR LOGOUT PAGE!\">\n");
55  if (samlClient.requiresClientSignature() || samlClient.requiresEncryption()) {
56  buffer.append(" <Keys>\n");
57  if (samlClient.requiresClientSignature()) {
58  buffer.append(" <Key signing=\"true\">\n");
59  buffer.append(" <PrivateKeyPem>\n");
60  if (samlClient.getClientSigningPrivateKey() == null) {
61  buffer.append(" PRIVATE KEY NOT SET UP OR KNOWN\n");
62  } else {
63  buffer.append(" ").append(samlClient.getClientSigningPrivateKey()).append("\n");
64  }
65  buffer.append(" </PrivateKeyPem>\n");
66  buffer.append(" <CertificatePem>\n");
67  if (samlClient.getClientSigningCertificate() == null) {
68  buffer.append(" YOU MUST CONFIGURE YOUR CLIENT's SIGNING CERTIFICATE\n");
69  } else {
70  buffer.append(" ").append(samlClient.getClientSigningCertificate()).append("\n");
71  }
72  buffer.append(" </CertificatePem>\n");
73  buffer.append(" </Key>\n");
74  }
75  if (samlClient.requiresEncryption()) {
76  buffer.append(" <Key encryption=\"true\">\n");
77  buffer.append(" <PrivateKeyPem>\n");
78  if (samlClient.getClientEncryptingPrivateKey() == null) {
79  buffer.append(" PRIVATE KEY NOT SET UP OR KNOWN\n");
80  } else {
81  buffer.append(" ").append(samlClient.getClientEncryptingPrivateKey()).append("\n");
82  }
83  buffer.append(" </PrivateKeyPem>\n");
84  buffer.append(" </Key>\n");
85 
86  }
87  buffer.append(" </Keys>\n");
88  }
89  buffer.append(" <IDP entityID=\"idp\"");
90  if (samlClient.requiresClientSignature()) {
91  buffer.append("\n signatureAlgorithm=\"").append(samlClient.getSignatureAlgorithm()).append("\"");
92  if (samlClient.getCanonicalizationMethod() != null) {
93  buffer.append("\n signatureCanonicalizationMethod=\"").append(samlClient.getCanonicalizationMethod()).append("\"");
94  }
95  }
96  buffer.append(">\n");
97  buffer.append(" <SingleSignOnService signRequest=\"").append(Boolean.toString(samlClient.requiresClientSignature())).append("\"\n");
98  buffer.append(" validateResponseSignature=\"").append(Boolean.toString(samlClient.requiresRealmSignature())).append("\"\n");
99  buffer.append(" validateAssertionSignature=\"").append(Boolean.toString(samlClient.requiresAssertionSignature())).append("\"\n");
100  buffer.append(" requestBinding=\"POST\"\n");
101  UriBuilder bindingUrlBuilder = UriBuilder.fromUri(baseUri);
102  String bindingUrl = RealmsResource.protocolUrl(bindingUrlBuilder)
103  .build(realm.getName(), SamlProtocol.LOGIN_PROTOCOL).toString();
104  buffer.append(" bindingUrl=\"").append(bindingUrl).append("\"/>\n");
105 
106  buffer.append(" <SingleLogoutService signRequest=\"").append(Boolean.toString(samlClient.requiresClientSignature())).append("\"\n");
107  buffer.append(" signResponse=\"").append(Boolean.toString(samlClient.requiresClientSignature())).append("\"\n");
108  buffer.append(" validateRequestSignature=\"").append(Boolean.toString(samlClient.requiresRealmSignature())).append("\"\n");
109  buffer.append(" validateResponseSignature=\"").append(Boolean.toString(samlClient.requiresRealmSignature())).append("\"\n");
110  buffer.append(" requestBinding=\"POST\"\n");
111  buffer.append(" responseBinding=\"POST\"\n");
112  buffer.append(" postBindingUrl=\"").append(bindingUrl).append("\"\n");
113  buffer.append(" redirectBindingUrl=\"").append(bindingUrl).append("\"");
114  buffer.append("/>\n");
115  buffer.append(" </IDP>\n");
116  buffer.append(" </SP>\n");
117  }

◆ close()

void org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.close ( )
inline
150  {
151 
152  }

◆ create()

ClientInstallationProvider org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.create ( KeycloakSession  session)
inline
155  {
156  return this;
157  }

◆ generateInstallation()

Response org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.generateInstallation ( KeycloakSession  session,
RealmModel  realm,
ClientModel  client,
URI  baseUri 
)
inline
42  {
43  SamlClient samlClient = new SamlClient(client);
44  StringBuilder buffer = new StringBuilder();
45  buffer.append("<keycloak-saml-adapter>\n");
46  baseXml(session, realm, client, baseUri, samlClient, buffer);
47  buffer.append("</keycloak-saml-adapter>\n");
48  return Response.ok(buffer.toString(), MediaType.TEXT_PLAIN_TYPE).build();
49  }
static void baseXml(KeycloakSession session, RealmModel realm, ClientModel client, URI baseUri, SamlClient samlClient, StringBuilder buffer)
Definition: KeycloakSamlClientInstallation.java:51

◆ getDisplayType()

String org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.getDisplayType ( )
inline
125  {
126  return "Keycloak SAML Adapter keycloak-saml.xml";
127  }

◆ getFilename()

String org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.getFilename ( )
inline
135  {
136  return "keycloak-saml.xml";
137  }

◆ getHelpText()

String org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.getHelpText ( )
inline
130  {
131  return "Keycloak SAML adapter configuration file. Put this in WEB-INF directory of your WAR.";
132  }

◆ getId()

String org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.getId ( )
inline
170  {
171  return "keycloak-saml";
172  }

◆ getMediaType()

String org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.getMediaType ( )
inline
140  {
141  return MediaType.APPLICATION_XML;
142  }

◆ getProtocol()

String org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.getProtocol ( )
inline
120  {
121  return SamlProtocol.LOGIN_PROTOCOL;
122  }

◆ init()

void org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.init ( Config.Scope  config)
inline
160  {
161 
162  }

◆ isDownloadOnly()

boolean org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.isDownloadOnly ( )
inline
145  {
146  return false;
147  }

◆ postInit()

void org.keycloak.protocol.saml.installation.KeycloakSamlClientInstallation.postInit ( KeycloakSessionFactory  factory)
inline
165  {
166 
167  }

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