keycloak-service
公開メンバ関数 | 静的公開メンバ関数 | 静的公開変数類 | 限定公開メンバ関数 | 限定公開変数類 | 静的限定公開変数類 | 非公開メンバ関数 | 静的非公開変数類 | 全メンバ一覧
org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService クラス
org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService の継承関係図
Inheritance graph
org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService 連携図
Collaboration graph

公開メンバ関数

 SamlEcpProfileService (RealmModel realm, EventBuilder event, DestinationValidator destinationValidator)
 
Response authenticate (InputStream inputStream)
 
Response redirectBinding (@QueryParam(GeneralConstants.SAML_REQUEST_KEY) String samlRequest, @QueryParam(GeneralConstants.SAML_RESPONSE_KEY) String samlResponse, @QueryParam(GeneralConstants.RELAY_STATE) String relayState)
 
Response postBinding (@FormParam(GeneralConstants.SAML_REQUEST_KEY) String samlRequest, @FormParam(GeneralConstants.SAML_RESPONSE_KEY) String samlResponse, @FormParam(GeneralConstants.RELAY_STATE) String relayState)
 
String getDescriptor () throws Exception
 
Response idpInitiatedSSO (@PathParam("client") String clientUrlName, @QueryParam("RelayState") String relayState)
 
AuthenticationSessionModel getOrCreateLoginSessionForIdpInitiatedSso (KeycloakSession session, RealmModel realm, ClientModel client, String relayState)
 
Response soapBinding (InputStream inputStream)
 

静的公開メンバ関数

static String getIDPMetadataDescriptor (UriInfo uriInfo, KeycloakSession session, RealmModel realm) throws IOException
 

静的公開変数類

static final String APP_INITIATED_FLOW = "APP_INITIATED_FLOW"
 

限定公開メンバ関数

Response newBrowserAuthentication (AuthenticationSessionModel authSession, boolean isPassive, boolean redirectToAuthentication, SamlProtocol samlProtocol)
 
AuthenticationFlowModel getAuthenticationFlow (AuthenticationSessionModel authSession)
 
Response newBrowserAuthentication (AuthenticationSessionModel authSession, boolean isPassive, boolean redirectToAuthentication)
 
AuthenticationProcessor createProcessor (AuthenticationSessionModel authSession, String flowId, String flowPath)
 
Response handleBrowserAuthenticationRequest (AuthenticationSessionModel authSession, LoginProtocol protocol, boolean isPassive, boolean redirectToAuthentication)
 
void checkSsl ()
 
void checkRealm ()
 
AuthenticationSessionModel createAuthenticationSession (ClientModel client, String requestState)
 

限定公開変数類

RealmModel realm
 
EventBuilder event
 
AuthenticationManager authManager
 
HttpHeaders headers
 
HttpRequest httpRequest
 
KeycloakSession session
 
ClientConnection clientConnection
 

静的限定公開変数類

static final Logger logger = Logger.getLogger(SamlService.class)
 

非公開メンバ関数

SamlProtocol createEcpSamlProtocol ()
 

静的非公開変数類

static final String NS_PREFIX_PROFILE_ECP = "ecp"
 
static final String NS_PREFIX_SAML_PROTOCOL = "samlp"
 
static final String NS_PREFIX_SAML_ASSERTION = "saml"
 

詳解

著者
Pedro Igor

構築子と解体子

◆ SamlEcpProfileService()

org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService.SamlEcpProfileService ( RealmModel  realm,
EventBuilder  event,
DestinationValidator  destinationValidator 
)
inline
58  {
60  }
final DestinationValidator destinationValidator
Definition: SamlService.java:101
EventBuilder event
Definition: AuthorizationEndpointBase.java:61
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

関数詳解

◆ authenticate()

Response org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService.authenticate ( InputStream  inputStream)
inline
62  {
63  try {
64  return new PostBindingProtocol() {
65  @Override
66  protected String getBindingType(AuthnRequestType requestAbstractType) {
67  return SamlProtocol.SAML_SOAP_BINDING;
68  }
69 
70  @Override
71  protected Response loginRequest(String relayState, AuthnRequestType requestAbstractType, ClientModel client) {
72  // force passive authentication when executing this profile
73  requestAbstractType.setIsPassive(true);
74  requestAbstractType.setDestination(session.getContext().getUri().getAbsolutePath());
75  return super.loginRequest(relayState, requestAbstractType, client);
76  }
77  }.execute(Soap.toSamlHttpPostMessage(inputStream), null, null);
78  } catch (Exception e) {
79  String reason = "Some error occurred while processing the AuthnRequest.";
80  String detail = e.getMessage();
81 
82  if (detail == null) {
83  detail = reason;
84  }
85 
86  return Soap.createFault().reason(reason).detail(detail).build();
87  }
88  }
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69

◆ checkRealm()

void org.keycloak.protocol.AuthorizationEndpointBase.checkRealm ( )
inlineprotectedinherited
159  {
160  if (!realm.isEnabled()) {
161  event.error(Errors.REALM_DISABLED);
162  throw new ErrorPageException(session, Response.Status.BAD_REQUEST, Messages.REALM_NOT_ENABLED);
163  }
164  }
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ checkSsl()

void org.keycloak.protocol.AuthorizationEndpointBase.checkSsl ( )
inlineprotectedinherited
152  {
153  if (!session.getContext().getUri().getBaseUri().getScheme().equals("https") && realm.getSslRequired().isRequired(clientConnection)) {
154  event.error(Errors.SSL_REQUIRED);
155  throw new ErrorPageException(session, Response.Status.BAD_REQUEST, Messages.HTTPS_REQUIRED);
156  }
157  }
ClientConnection clientConnection
Definition: AuthorizationEndpointBase.java:71
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ createAuthenticationSession()

AuthenticationSessionModel org.keycloak.protocol.AuthorizationEndpointBase.createAuthenticationSession ( ClientModel  client,
String  requestState 
)
inlineprotectedinherited
166  {
167  AuthenticationSessionManager manager = new AuthenticationSessionManager(session);
168  RootAuthenticationSessionModel rootAuthSession = manager.getCurrentRootAuthenticationSession(realm);
169 
170  AuthenticationSessionModel authSession;
171 
172  if (rootAuthSession != null) {
173  authSession = rootAuthSession.createAuthenticationSession(client);
174 
175  logger.debugf("Sent request to authz endpoint. Root authentication session with ID '%s' exists. Client is '%s' . Created new authentication session with tab ID: %s",
176  rootAuthSession.getId(), client.getClientId(), authSession.getTabId());
177  } else {
178  UserSessionCrossDCManager userSessionCrossDCManager = new UserSessionCrossDCManager(session);
179  UserSessionModel userSession = userSessionCrossDCManager.getUserSessionIfExistsRemotely(manager, realm);
180 
181  if (userSession != null) {
182  String userSessionId = userSession.getId();
183  rootAuthSession = session.authenticationSessions().createRootAuthenticationSession(userSessionId, realm);
184  authSession = rootAuthSession.createAuthenticationSession(client);
185  logger.debugf("Sent request to authz endpoint. We don't have root authentication session with ID '%s' but we have userSession." +
186  "Re-created root authentication session with same ID. Client is: %s . New authentication session tab ID: %s", userSessionId, client.getClientId(), authSession.getTabId());
187  } else {
188  rootAuthSession = manager.createAuthenticationSession(realm, true);
189  authSession = rootAuthSession.createAuthenticationSession(client);
190  logger.debugf("Sent request to authz endpoint. Created new root authentication session with ID '%s' . Client: %s . New authentication session tab ID: %s",
191  rootAuthSession.getId(), client.getClientId(), authSession.getTabId());
192  }
193  }
194 
195  session.getProvider(LoginFormsProvider.class).setAuthenticationSession(authSession);
196 
197  return authSession;
198 
199  }
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
static final Logger logger
Definition: AuthorizationEndpointBase.java:56
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ createEcpSamlProtocol()

SamlProtocol org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService.createEcpSamlProtocol ( )
inlineprivate
95  {
96  return new SamlProtocol() {
97  // method created to send a SOAP Binding response instead of a HTTP POST response
98  @Override
99  protected Response buildAuthenticatedResponse(AuthenticatedClientSessionModel clientSession, String redirectUri, Document samlDocument, JaxrsSAML2BindingBuilder bindingBuilder) throws ConfigurationException, ProcessingException, IOException {
100  Document document = bindingBuilder.postBinding(samlDocument).getDocument();
101 
102  try {
103  Soap.SoapMessageBuilder messageBuilder = Soap.createMessage()
104  .addNamespace(NS_PREFIX_SAML_ASSERTION, JBossSAMLURIConstants.ASSERTION_NSURI.get())
105  .addNamespace(NS_PREFIX_SAML_PROTOCOL, JBossSAMLURIConstants.PROTOCOL_NSURI.get())
106  .addNamespace(NS_PREFIX_PROFILE_ECP, JBossSAMLURIConstants.ECP_PROFILE.get());
107 
108  createEcpResponseHeader(redirectUri, messageBuilder);
109  createRequestAuthenticatedHeader(clientSession, messageBuilder);
110 
111  messageBuilder.addToBody(document);
112 
113  return messageBuilder.build();
114  } catch (Exception e) {
115  throw new RuntimeException("Error while creating SAML response.", e);
116  }
117  }
118 
119  private void createRequestAuthenticatedHeader(AuthenticatedClientSessionModel clientSession, Soap.SoapMessageBuilder messageBuilder) {
120  ClientModel client = clientSession.getClient();
121 
122  if ("true".equals(client.getAttribute(SamlConfigAttributes.SAML_CLIENT_SIGNATURE_ATTRIBUTE))) {
123  SOAPHeaderElement ecpRequestAuthenticated = messageBuilder.addHeader(JBossSAMLConstants.REQUEST_AUTHENTICATED.get(), NS_PREFIX_PROFILE_ECP);
124 
125  ecpRequestAuthenticated.setMustUnderstand(true);
126  ecpRequestAuthenticated.setActor("http://schemas.xmlsoap.org/soap/actor/next");
127  }
128  }
129 
130  private void createEcpResponseHeader(String redirectUri, Soap.SoapMessageBuilder messageBuilder) throws SOAPException {
131  SOAPHeaderElement ecpResponseHeader = messageBuilder.addHeader(JBossSAMLConstants.RESPONSE__ECP.get(), NS_PREFIX_PROFILE_ECP);
132 
133  ecpResponseHeader.setMustUnderstand(true);
134  ecpResponseHeader.setActor("http://schemas.xmlsoap.org/soap/actor/next");
135  ecpResponseHeader.addAttribute(messageBuilder.createName(JBossSAMLConstants.ASSERTION_CONSUMER_SERVICE_URL.get()), redirectUri);
136  }
137 
138  @Override
139  protected Response buildErrorResponse(boolean isPostBinding, String uri, JaxrsSAML2BindingBuilder binding, Document document) throws ConfigurationException, ProcessingException, IOException {
140  return Soap.createMessage().addToBody(document).build();
141  }
142 
143  @Override
144  protected Response buildLogoutResponse(UserSessionModel userSession, String logoutBindingUri, SAML2LogoutResponseBuilder builder, JaxrsSAML2BindingBuilder binding) throws ConfigurationException, ProcessingException, IOException {
145  return Soap.createFault().reason("Logout not supported.").build();
146  }
147  }.setEventBuilder(event).setHttpHeaders(headers).setRealm(realm).setSession(session).setUriInfo(session.getContext().getUri());
148  }
static final String NS_PREFIX_SAML_ASSERTION
Definition: SamlEcpProfileService.java:56
static final String NS_PREFIX_SAML_PROTOCOL
Definition: SamlEcpProfileService.java:55
HttpHeaders headers
Definition: AuthorizationEndpointBase.java:65
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
static final String NS_PREFIX_PROFILE_ECP
Definition: SamlEcpProfileService.java:54
EventBuilder event
Definition: AuthorizationEndpointBase.java:61
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ createProcessor()

AuthenticationProcessor org.keycloak.protocol.AuthorizationEndpointBase.createProcessor ( AuthenticationSessionModel  authSession,
String  flowId,
String  flowPath 
)
inlineprotectedinherited
78  {
79  AuthenticationProcessor processor = new AuthenticationProcessor();
80  processor.setAuthenticationSession(authSession)
81  .setFlowPath(flowPath)
82  .setFlowId(flowId)
83  .setBrowserFlow(true)
84  .setConnection(clientConnection)
85  .setEventBuilder(event)
86  .setRealm(realm)
87  .setSession(session)
88  .setUriInfo(session.getContext().getUri())
89  .setRequest(httpRequest);
90 
91  authSession.setAuthNote(AuthenticationProcessor.CURRENT_FLOW_PATH, flowPath);
92 
93  return processor;
94  }
HttpRequest httpRequest
Definition: AuthorizationEndpointBase.java:67
ClientConnection clientConnection
Definition: AuthorizationEndpointBase.java:71
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
EventBuilder event
Definition: AuthorizationEndpointBase.java:61
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ getAuthenticationFlow()

AuthenticationFlowModel org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService.getAuthenticationFlow ( AuthenticationSessionModel  authSession)
inlineprotected
151  {
152  for (AuthenticationFlowModel flowModel : realm.getAuthenticationFlows()) {
153  if (flowModel.getAlias().equals(DefaultAuthenticationFlows.SAML_ECP_FLOW)) {
154  return flowModel;
155  }
156  }
157 
158  throw new RuntimeException("Could not resolve authentication flow for SAML ECP Profile.");
159  }
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ getDescriptor()

String org.keycloak.protocol.saml.SamlService.getDescriptor ( ) throws Exception
inlineinherited
576  {
577  return getIDPMetadataDescriptor(session.getContext().getUri(), session, realm);
578 
579  }
static String getIDPMetadataDescriptor(UriInfo uriInfo, KeycloakSession session, RealmModel realm)
Definition: SamlService.java:581
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ getIDPMetadataDescriptor()

static String org.keycloak.protocol.saml.SamlService.getIDPMetadataDescriptor ( UriInfo  uriInfo,
KeycloakSession  session,
RealmModel  realm 
) throws IOException
inlinestaticinherited
581  {
582  InputStream is = SamlService.class.getResourceAsStream("/idp-metadata-template.xml");
583  String template = StreamUtil.readString(is);
584  Properties props = new Properties();
585  props.put("idp.entityID", RealmsResource.realmBaseUrl(uriInfo).build(realm.getName()).toString());
586  props.put("idp.sso.HTTP-POST", RealmsResource.protocolUrl(uriInfo).build(realm.getName(), SamlProtocol.LOGIN_PROTOCOL).toString());
587  props.put("idp.sso.HTTP-Redirect", RealmsResource.protocolUrl(uriInfo).build(realm.getName(), SamlProtocol.LOGIN_PROTOCOL).toString());
588  props.put("idp.sls.HTTP-POST", RealmsResource.protocolUrl(uriInfo).build(realm.getName(), SamlProtocol.LOGIN_PROTOCOL).toString());
589  StringBuilder keysString = new StringBuilder();
590  Set<RsaKeyMetadata> keys = new TreeSet<>((o1, o2) -> o1.getStatus() == o2.getStatus() // Status can be only PASSIVE OR ACTIVE, push PASSIVE to end of list
591  ? (int) (o2.getProviderPriority() - o1.getProviderPriority())
592  : (o1.getStatus() == KeyStatus.PASSIVE ? 1 : -1));
593  keys.addAll(session.keys().getRsaKeys(realm));
594  for (RsaKeyMetadata key : keys) {
595  addKeyInfo(keysString, key, KeyTypes.SIGNING.value());
596  }
597  props.put("idp.signing.certificates", keysString.toString());
598  return StringPropertyReplacer.replaceProperties(template, props);
599  }
SamlService(RealmModel realm, EventBuilder event, DestinationValidator destinationValidator)
Definition: SamlService.java:103
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
static void addKeyInfo(StringBuilder target, RsaKeyMetadata key, String purpose)
Definition: SamlService.java:601
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ getOrCreateLoginSessionForIdpInitiatedSso()

AuthenticationSessionModel org.keycloak.protocol.saml.SamlService.getOrCreateLoginSessionForIdpInitiatedSso ( KeycloakSession  session,
RealmModel  realm,
ClientModel  client,
String  relayState 
)
inlineinherited

Creates a client session object for SAML IdP-initiated SSO session. The session takes the parameters from from client definition, namely binding type and redirect URL.

引数
sessionKC session
realmRealm to create client session in
clientClient to create client session for
relayStateOptional relay state - free field as per SAML specification
戻り値
658  {
659  String bindingType = SamlProtocol.SAML_POST_BINDING;
660  if (client.getManagementUrl() == null && client.getAttribute(SamlProtocol.SAML_ASSERTION_CONSUMER_URL_POST_ATTRIBUTE) == null && client.getAttribute(SamlProtocol.SAML_ASSERTION_CONSUMER_URL_REDIRECT_ATTRIBUTE) != null) {
661  bindingType = SamlProtocol.SAML_REDIRECT_BINDING;
662  }
663 
664  String redirect;
665  if (bindingType.equals(SamlProtocol.SAML_REDIRECT_BINDING)) {
666  redirect = client.getAttribute(SamlProtocol.SAML_ASSERTION_CONSUMER_URL_REDIRECT_ATTRIBUTE);
667  } else {
668  redirect = client.getAttribute(SamlProtocol.SAML_ASSERTION_CONSUMER_URL_POST_ATTRIBUTE);
669  }
670  if (redirect == null) {
671  redirect = client.getManagementUrl();
672  }
673 
674  AuthenticationSessionModel authSession = createAuthenticationSession(client, null);
675 
676  authSession.setProtocol(SamlProtocol.LOGIN_PROTOCOL);
677  authSession.setAction(AuthenticationSessionModel.Action.AUTHENTICATE.name());
678  authSession.setClientNote(SamlProtocol.SAML_BINDING, SamlProtocol.SAML_POST_BINDING);
679  authSession.setClientNote(SamlProtocol.SAML_IDP_INITIATED_LOGIN, "true");
680  authSession.setRedirectUri(redirect);
681 
682  if (relayState == null) {
683  relayState = client.getAttribute(SamlProtocol.SAML_IDP_INITIATED_SSO_RELAY_STATE);
684  }
685  if (relayState != null && !relayState.trim().equals("")) {
686  authSession.setClientNote(GeneralConstants.RELAY_STATE, relayState);
687  }
688 
689  return authSession;
690  }
AuthenticationSessionModel createAuthenticationSession(ClientModel client, String requestState)
Definition: AuthorizationEndpointBase.java:166

◆ handleBrowserAuthenticationRequest()

Response org.keycloak.protocol.AuthorizationEndpointBase.handleBrowserAuthenticationRequest ( AuthenticationSessionModel  authSession,
LoginProtocol  protocol,
boolean  isPassive,
boolean  redirectToAuthentication 
)
inlineprotectedinherited

Common method to handle browser authentication request in protocols unified way.

引数
authSessionfor current request
protocolhandler for protocol used to initiate login
isPassiveset to true if login should be passive (without login screen shown)
redirectToAuthenticationif true redirect to flow url. If initial call to protocol is a POST, you probably want to do this. This is so we can disable the back button on browser
戻り値
response to be returned to the browser
105  {
106  AuthenticationFlowModel flow = getAuthenticationFlow(authSession);
107  String flowId = flow.getId();
108  AuthenticationProcessor processor = createProcessor(authSession, flowId, LoginActionsService.AUTHENTICATE_PATH);
109  event.detail(Details.CODE_ID, authSession.getParentSession().getId());
110  if (isPassive) {
111  // OIDC prompt == NONE or SAML 2 IsPassive flag
112  // This means that client is just checking if the user is already completely logged in.
113  // We cancel login if any authentication action or required action is required
114  try {
115  if (processor.authenticateOnly() == null) {
116  // processor.attachSession();
117  } else {
118  Response response = protocol.sendError(authSession, Error.PASSIVE_LOGIN_REQUIRED);
119  return response;
120  }
121 
122  AuthenticationManager.setClientScopesInSession(authSession);
123 
124  if (processor.nextRequiredAction() != null) {
125  Response response = protocol.sendError(authSession, Error.PASSIVE_INTERACTION_REQUIRED);
126  return response;
127  }
128 
129  // Attach session once no requiredActions or other things are required
130  processor.attachSession();
131  } catch (Exception e) {
132  return processor.handleBrowserException(e);
133  }
134  return processor.finishAuthentication(protocol);
135  } else {
136  try {
137  RestartLoginCookie.setRestartCookie(session, realm, clientConnection, session.getContext().getUri(), authSession);
138  if (redirectToAuthentication) {
139  return processor.redirectToFlow();
140  }
141  return processor.authenticate();
142  } catch (Exception e) {
143  return processor.handleBrowserException(e);
144  }
145  }
146  }
ClientConnection clientConnection
Definition: AuthorizationEndpointBase.java:71
AuthenticationFlowModel getAuthenticationFlow(AuthenticationSessionModel authSession)
Definition: AuthorizationEndpointBase.java:148
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
AuthenticationProcessor createProcessor(AuthenticationSessionModel authSession, String flowId, String flowPath)
Definition: AuthorizationEndpointBase.java:78
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ idpInitiatedSSO()

Response org.keycloak.protocol.saml.SamlService.idpInitiatedSSO ( @PathParam("client") String  clientUrlName,
@QueryParam("RelayState") String  relayState 
)
inlineinherited
613  {
614  event.event(EventType.LOGIN);
615  CacheControlUtil.noBackButtonCacheControlHeader();
616  ClientModel client = null;
617  for (ClientModel c : realm.getClients()) {
618  String urlName = c.getAttribute(SamlProtocol.SAML_IDP_INITIATED_SSO_URL_NAME);
619  if (urlName == null)
620  continue;
621  if (urlName.equals(clientUrlName)) {
622  client = c;
623  break;
624  }
625  }
626  if (client == null) {
627  event.error(Errors.CLIENT_NOT_FOUND);
628  return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.CLIENT_NOT_FOUND);
629  }
630  if (!client.isEnabled()) {
631  event.error(Errors.CLIENT_DISABLED);
632  return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.CLIENT_DISABLED);
633  }
634  if (client.getManagementUrl() == null && client.getAttribute(SamlProtocol.SAML_ASSERTION_CONSUMER_URL_POST_ATTRIBUTE) == null && client.getAttribute(SamlProtocol.SAML_ASSERTION_CONSUMER_URL_REDIRECT_ATTRIBUTE) == null) {
635  logger.error("SAML assertion consumer url not set up");
636  event.error(Errors.INVALID_REDIRECT_URI);
637  return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_REDIRECT_URI);
638  }
639 
640  session.getContext().setClient(client);
641 
642  AuthenticationSessionModel authSession = getOrCreateLoginSessionForIdpInitiatedSso(this.session, this.realm, client, relayState);
643 
644  return newBrowserAuthentication(authSession, false, false);
645  }
static final Logger logger
Definition: SamlService.java:99
Response newBrowserAuthentication(AuthenticationSessionModel authSession, boolean isPassive, boolean redirectToAuthentication)
Definition: SamlService.java:539
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
AuthenticationSessionModel getOrCreateLoginSessionForIdpInitiatedSso(KeycloakSession session, RealmModel realm, ClientModel client, String relayState)
Definition: SamlService.java:658
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ newBrowserAuthentication() [1/2]

Response org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService.newBrowserAuthentication ( AuthenticationSessionModel  authSession,
boolean  isPassive,
boolean  redirectToAuthentication,
SamlProtocol  samlProtocol 
)
inlineprotected
91  {
92  return super.newBrowserAuthentication(authSession, isPassive, redirectToAuthentication, createEcpSamlProtocol());
93  }
SamlProtocol createEcpSamlProtocol()
Definition: SamlEcpProfileService.java:95

◆ newBrowserAuthentication() [2/2]

Response org.keycloak.protocol.saml.SamlService.newBrowserAuthentication ( AuthenticationSessionModel  authSession,
boolean  isPassive,
boolean  redirectToAuthentication 
)
inlineprotectedinherited
539  {
540  SamlProtocol samlProtocol = new SamlProtocol().setEventBuilder(event).setHttpHeaders(headers).setRealm(realm).setSession(session).setUriInfo(session.getContext().getUri());
541  return newBrowserAuthentication(authSession, isPassive, redirectToAuthentication, samlProtocol);
542  }
Response newBrowserAuthentication(AuthenticationSessionModel authSession, boolean isPassive, boolean redirectToAuthentication)
Definition: SamlService.java:539
HttpHeaders headers
Definition: AuthorizationEndpointBase.java:65
KeycloakSession session
Definition: AuthorizationEndpointBase.java:69
EventBuilder event
Definition: AuthorizationEndpointBase.java:61
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

◆ postBinding()

Response org.keycloak.protocol.saml.SamlService.postBinding ( @FormParam(GeneralConstants.SAML_REQUEST_KEY) String  samlRequest,
@FormParam(GeneralConstants.SAML_RESPONSE_KEY) String  samlResponse,
@FormParam(GeneralConstants.RELAY_STATE) String  relayState 
)
inlineinherited
562  {
563  logger.debug("SAML POST");
564  PostBindingProtocol postBindingProtocol = new PostBindingProtocol();
565  // this is to support back button on browser
566  // if true, we redirect to authenticate URL otherwise back button behavior has bad side effects
567  // and we want to turn it off.
568  postBindingProtocol.redirectToAuthentication = true;
569  return postBindingProtocol.execute(samlRequest, samlResponse, relayState);
570  }
static final Logger logger
Definition: SamlService.java:99

◆ redirectBinding()

Response org.keycloak.protocol.saml.SamlService.redirectBinding ( @QueryParam(GeneralConstants.SAML_REQUEST_KEY) String  samlRequest,
@QueryParam(GeneralConstants.SAML_RESPONSE_KEY) String  samlResponse,
@QueryParam(GeneralConstants.RELAY_STATE) String  relayState 
)
inlineinherited
551  {
552  logger.debug("SAML GET");
553  CacheControlUtil.noBackButtonCacheControlHeader();
554  return new RedirectBindingProtocol().execute(samlRequest, samlResponse, relayState);
555  }
static final Logger logger
Definition: SamlService.java:99

◆ soapBinding()

Response org.keycloak.protocol.saml.SamlService.soapBinding ( InputStream  inputStream)
inlineinherited
696  {
697  SamlEcpProfileService bindingService = new SamlEcpProfileService(realm, event, destinationValidator);
698 
699  ResteasyProviderFactory.getInstance().injectProperties(bindingService);
700 
701  return bindingService.authenticate(inputStream);
702  }
final DestinationValidator destinationValidator
Definition: SamlService.java:101
EventBuilder event
Definition: AuthorizationEndpointBase.java:61
RealmModel realm
Definition: AuthorizationEndpointBase.java:60

メンバ詳解

◆ APP_INITIATED_FLOW

final String org.keycloak.protocol.AuthorizationEndpointBase.APP_INITIATED_FLOW = "APP_INITIATED_FLOW"
staticinherited

◆ authManager

AuthenticationManager org.keycloak.protocol.AuthorizationEndpointBase.authManager
protectedinherited

◆ clientConnection

ClientConnection org.keycloak.protocol.AuthorizationEndpointBase.clientConnection
protectedinherited

◆ event

EventBuilder org.keycloak.protocol.AuthorizationEndpointBase.event
protectedinherited

◆ headers

HttpHeaders org.keycloak.protocol.AuthorizationEndpointBase.headers
protectedinherited

◆ httpRequest

HttpRequest org.keycloak.protocol.AuthorizationEndpointBase.httpRequest
protectedinherited

◆ logger

final Logger org.keycloak.protocol.saml.SamlService.logger = Logger.getLogger(SamlService.class)
staticprotectedinherited

◆ NS_PREFIX_PROFILE_ECP

final String org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService.NS_PREFIX_PROFILE_ECP = "ecp"
staticprivate

◆ NS_PREFIX_SAML_ASSERTION

final String org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService.NS_PREFIX_SAML_ASSERTION = "saml"
staticprivate

◆ NS_PREFIX_SAML_PROTOCOL

final String org.keycloak.protocol.saml.profile.ecp.SamlEcpProfileService.NS_PREFIX_SAML_PROTOCOL = "samlp"
staticprivate

◆ realm

RealmModel org.keycloak.protocol.AuthorizationEndpointBase.realm
protectedinherited

◆ session

KeycloakSession org.keycloak.protocol.AuthorizationEndpointBase.session
protectedinherited

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