2 * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package edu.internet2.middleware.shibboleth.idp.profile.saml2;
19 import java.io.IOException;
20 import java.util.ArrayList;
22 import javax.servlet.RequestDispatcher;
23 import javax.servlet.ServletException;
24 import javax.servlet.http.HttpServletRequest;
25 import javax.servlet.http.HttpSession;
27 import org.opensaml.common.SAMLObjectBuilder;
28 import org.opensaml.common.binding.decoding.SAMLMessageDecoder;
29 import org.opensaml.common.xml.SAMLConstants;
30 import org.opensaml.saml2.binding.AuthnResponseEndpointSelector;
31 import org.opensaml.saml2.core.AttributeStatement;
32 import org.opensaml.saml2.core.AuthnContext;
33 import org.opensaml.saml2.core.AuthnContextClassRef;
34 import org.opensaml.saml2.core.AuthnContextDeclRef;
35 import org.opensaml.saml2.core.AuthnRequest;
36 import org.opensaml.saml2.core.AuthnStatement;
37 import org.opensaml.saml2.core.RequestedAuthnContext;
38 import org.opensaml.saml2.core.Response;
39 import org.opensaml.saml2.core.Statement;
40 import org.opensaml.saml2.core.StatusCode;
41 import org.opensaml.saml2.core.Subject;
42 import org.opensaml.saml2.core.SubjectLocality;
43 import org.opensaml.saml2.metadata.AssertionConsumerService;
44 import org.opensaml.saml2.metadata.Endpoint;
45 import org.opensaml.saml2.metadata.EntityDescriptor;
46 import org.opensaml.saml2.metadata.IDPSSODescriptor;
47 import org.opensaml.saml2.metadata.SPSSODescriptor;
48 import org.opensaml.saml2.metadata.provider.MetadataProvider;
49 import org.opensaml.saml2.metadata.provider.MetadataProviderException;
50 import org.opensaml.ws.message.decoder.MessageDecodingException;
51 import org.opensaml.ws.transport.http.HTTPInTransport;
52 import org.opensaml.ws.transport.http.HTTPOutTransport;
53 import org.opensaml.ws.transport.http.HttpServletRequestAdapter;
54 import org.opensaml.ws.transport.http.HttpServletResponseAdapter;
55 import org.opensaml.xml.io.MarshallingException;
56 import org.opensaml.xml.io.UnmarshallingException;
57 import org.opensaml.xml.security.SecurityException;
58 import org.opensaml.xml.util.DatatypeHelper;
59 import org.slf4j.Logger;
60 import org.slf4j.LoggerFactory;
62 import edu.internet2.middleware.shibboleth.common.profile.ProfileException;
63 import edu.internet2.middleware.shibboleth.common.relyingparty.ProfileConfiguration;
64 import edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfiguration;
65 import edu.internet2.middleware.shibboleth.common.relyingparty.provider.saml2.SSOConfiguration;
66 import edu.internet2.middleware.shibboleth.common.util.HttpHelper;
67 import edu.internet2.middleware.shibboleth.idp.authn.LoginContext;
68 import edu.internet2.middleware.shibboleth.idp.authn.Saml2LoginContext;
70 /** SAML 2.0 SSO request profile handler. */
71 public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
74 private final Logger log = LoggerFactory.getLogger(SSOProfileHandler.class);
76 /** Builder of AuthnStatement objects. */
77 private SAMLObjectBuilder<AuthnStatement> authnStatementBuilder;
79 /** Builder of AuthnContext objects. */
80 private SAMLObjectBuilder<AuthnContext> authnContextBuilder;
82 /** Builder of AuthnContextClassRef objects. */
83 private SAMLObjectBuilder<AuthnContextClassRef> authnContextClassRefBuilder;
85 /** Builder of AuthnContextDeclRef objects. */
86 private SAMLObjectBuilder<AuthnContextDeclRef> authnContextDeclRefBuilder;
88 /** Builder of SubjectLocality objects. */
89 private SAMLObjectBuilder<SubjectLocality> subjectLocalityBuilder;
91 /** URL of the authentication manager servlet. */
92 private String authenticationManagerPath;
94 /** URI of request decoder. */
95 private String decodingBinding;
100 * @param authnManagerPath path to the authentication manager servlet
102 @SuppressWarnings("unchecked")
103 public SSOProfileHandler(String authnManagerPath) {
106 authenticationManagerPath = authnManagerPath;
108 authnStatementBuilder = (SAMLObjectBuilder<AuthnStatement>) getBuilderFactory().getBuilder(
109 AuthnStatement.DEFAULT_ELEMENT_NAME);
110 authnContextBuilder = (SAMLObjectBuilder<AuthnContext>) getBuilderFactory().getBuilder(
111 AuthnContext.DEFAULT_ELEMENT_NAME);
112 authnContextClassRefBuilder = (SAMLObjectBuilder<AuthnContextClassRef>) getBuilderFactory().getBuilder(
113 AuthnContextClassRef.DEFAULT_ELEMENT_NAME);
114 authnContextDeclRefBuilder = (SAMLObjectBuilder<AuthnContextDeclRef>) getBuilderFactory().getBuilder(
115 AuthnContextDeclRef.DEFAULT_ELEMENT_NAME);
116 subjectLocalityBuilder = (SAMLObjectBuilder<SubjectLocality>) getBuilderFactory().getBuilder(
117 SubjectLocality.DEFAULT_ELEMENT_NAME);
121 public String getProfileId() {
122 return "urn:mace:shibboleth:2.0:idp:profiles:saml2:request:sso";
126 public void processRequest(HTTPInTransport inTransport, HTTPOutTransport outTransport) throws ProfileException {
127 HttpServletRequest servletRequest = ((HttpServletRequestAdapter) inTransport).getWrappedRequest();
128 HttpSession httpSession = servletRequest.getSession(true);
129 LoginContext loginContext = (LoginContext) httpSession.getAttribute(LoginContext.LOGIN_CONTEXT_KEY);
131 if (loginContext == null) {
132 log.debug("User session does not contain a login context, processing as first leg of request");
133 performAuthentication(inTransport, outTransport);
134 } else if (!loginContext.isPrincipalAuthenticated() && !loginContext.getAuthenticationAttempted()) {
135 log.debug("User session contained a login context but user was not authenticated, processing as first leg of request");
136 performAuthentication(inTransport, outTransport);
138 log.debug("User session contains a login context, processing as second leg of request");
139 completeAuthenticationRequest(inTransport, outTransport);
144 * Creates a {@link Saml2LoginContext} an sends the request off to the AuthenticationManager to begin the process of
145 * authenticating the user.
147 * @param inTransport inbound request transport
148 * @param outTransport outbound response transport
150 * @throws ProfileException thrown if there is a problem creating the login context and transferring control to the
151 * authentication manager
153 protected void performAuthentication(HTTPInTransport inTransport, HTTPOutTransport outTransport)
154 throws ProfileException {
155 HttpServletRequest servletRequest = ((HttpServletRequestAdapter) inTransport).getWrappedRequest();
156 HttpSession httpSession = servletRequest.getSession();
159 SSORequestContext requestContext = decodeRequest(inTransport, outTransport);
161 String relyingPartyId = requestContext.getInboundMessageIssuer();
162 RelyingPartyConfiguration rpConfig = getRelyingPartyConfiguration(relyingPartyId);
163 ProfileConfiguration ssoConfig = rpConfig.getProfileConfiguration(SSOConfiguration.PROFILE_ID);
164 if (ssoConfig == null) {
165 log.error("SAML 2 SSO profile is not configured for relying party "
166 + requestContext.getInboundMessageIssuer());
167 throw new ProfileException("SAML 2 SSO profile is not configured for relying party "
168 + requestContext.getInboundMessageIssuer());
171 log.debug("Creating login context and transferring control to authentication engine");
172 Saml2LoginContext loginContext = new Saml2LoginContext(relyingPartyId, requestContext.getRelayState(),
173 requestContext.getInboundSAMLMessage());
174 loginContext.setAuthenticationEngineURL(authenticationManagerPath);
175 loginContext.setProfileHandlerURL(HttpHelper.getRequestUriWithoutContext(servletRequest));
176 if (loginContext.getRequestedAuthenticationMethods().size() == 0) {
177 loginContext.getRequestedAuthenticationMethods().add(rpConfig.getDefaultAuthenticationMethod());
180 httpSession.setAttribute(Saml2LoginContext.LOGIN_CONTEXT_KEY, loginContext);
181 RequestDispatcher dispatcher = servletRequest.getRequestDispatcher(authenticationManagerPath);
182 dispatcher.forward(servletRequest, ((HttpServletResponseAdapter) outTransport).getWrappedResponse());
183 } catch (MarshallingException e) {
184 httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
185 log.error("Unable to marshall authentication request context");
186 throw new ProfileException("Unable to marshall authentication request context", e);
187 } catch (IOException ex) {
188 httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
189 log.error("Error forwarding SAML 2 AuthnRequest to AuthenticationManager", ex);
190 throw new ProfileException("Error forwarding SAML 2 AuthnRequest to AuthenticationManager", ex);
191 } catch (ServletException ex) {
192 httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
193 log.error("Error forwarding SAML 2 AuthnRequest to AuthenticationManager", ex);
194 throw new ProfileException("Error forwarding SAML 2 AuthnRequest to AuthenticationManager", ex);
199 * Creates a response to the {@link AuthnRequest} and sends the user, with response in tow, back to the relying
200 * party after they've been authenticated.
202 * @param inTransport inbound message transport
203 * @param outTransport outbound message transport
205 * @throws ProfileException thrown if the response can not be created and sent back to the relying party
207 protected void completeAuthenticationRequest(HTTPInTransport inTransport, HTTPOutTransport outTransport)
208 throws ProfileException {
209 HttpServletRequest servletRequest = ((HttpServletRequestAdapter) inTransport).getWrappedRequest();
210 HttpSession httpSession = servletRequest.getSession();
212 Saml2LoginContext loginContext = (Saml2LoginContext) httpSession.getAttribute(LoginContext.LOGIN_CONTEXT_KEY);
213 httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
215 SSORequestContext requestContext = buildRequestContext(loginContext, inTransport, outTransport);
217 checkSamlVersion(requestContext);
219 Response samlResponse;
221 if (loginContext.getPrincipalName() == null) {
222 log.error("User's login context did not contain a principal, user considered unauthenticiated.");
223 if (loginContext.getPassiveAuth()) {
225 .setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, StatusCode.NO_PASSIVE_URI, null));
228 .setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, StatusCode.AUTHN_FAILED_URI, null));
230 throw new ProfileException("User failed authentication");
233 if (requestContext.getSubjectNameIdentifier() != null) {
234 log.debug("Authentication request contained a subject with a name identifier, resolving principal from NameID");
235 resolvePrincipal(requestContext);
236 String requestedPrincipalName = requestContext.getPrincipalName();
237 if (!DatatypeHelper.safeEquals(loginContext.getPrincipalName(), requestedPrincipalName)) {
238 log.error("Authentication request identified principal {} but authentication mechanism identified principal {}",
239 requestedPrincipalName, loginContext.getPrincipalName());
240 requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, StatusCode.AUTHN_FAILED_URI,
242 throw new ProfileException("User failed authentication");
246 resolveAttributes(requestContext);
248 ArrayList<Statement> statements = new ArrayList<Statement>();
249 statements.add(buildAuthnStatement(requestContext));
250 if (requestContext.getProfileConfiguration().includeAttributeStatement()) {
251 AttributeStatement attributeStatement = buildAttributeStatement(requestContext);
252 if (attributeStatement != null) {
253 requestContext.setRequestedAttributes(requestContext.getPrincipalAttributes().keySet());
254 statements.add(attributeStatement);
258 samlResponse = buildResponse(requestContext, "urn:oasis:names:tc:SAML:2.0:cm:bearer", statements);
259 } catch (ProfileException e) {
260 samlResponse = buildErrorResponse(requestContext);
263 requestContext.setOutboundSAMLMessage(samlResponse);
264 requestContext.setOutboundSAMLMessageId(samlResponse.getID());
265 requestContext.setOutboundSAMLMessageIssueInstant(samlResponse.getIssueInstant());
266 encodeResponse(requestContext);
267 writeAuditLogEntry(requestContext);
271 * Decodes an incoming request and stores the information in a created request context.
273 * @param inTransport inbound transport
274 * @param outTransport outbound transport
276 * @return request context with decoded information
278 * @throws ProfileException thrown if the incoming message failed decoding
280 protected SSORequestContext decodeRequest(HTTPInTransport inTransport, HTTPOutTransport outTransport)
281 throws ProfileException {
282 log.debug("Decoding message with decoder binding {}", getInboundBinding());
283 SSORequestContext requestContext = new SSORequestContext();
284 requestContext.setMetadataProvider(getMetadataProvider());
285 requestContext.setSecurityPolicyResolver(getSecurityPolicyResolver());
287 requestContext.setCommunicationProfileId(SSOConfiguration.PROFILE_ID);
288 requestContext.setInboundMessageTransport(inTransport);
289 requestContext.setInboundSAMLProtocol(SAMLConstants.SAML20P_NS);
290 requestContext.setPeerEntityRole(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
292 requestContext.setOutboundMessageTransport(outTransport);
293 requestContext.setOutboundSAMLProtocol(SAMLConstants.SAML20P_NS);
296 SAMLMessageDecoder decoder = getMessageDecoders().get(getInboundBinding());
297 requestContext.setMessageDecoder(decoder);
298 decoder.decode(requestContext);
299 log.debug("Decoded request");
301 if (!(requestContext.getInboundMessage() instanceof AuthnRequest)) {
302 log.error("Incomming message was not a AuthnRequest, it was a {}", requestContext.getInboundMessage()
303 .getClass().getName());
304 requestContext.setFailureStatus(buildStatus(StatusCode.REQUESTER_URI, null,
305 "Invalid SAML AuthnRequest message."));
306 throw new ProfileException("Invalid SAML AuthnRequest message.");
309 return requestContext;
310 } catch (MessageDecodingException e) {
311 log.error("Error decoding authentication request message", e);
312 throw new ProfileException("Error decoding authentication request message", e);
313 } catch (SecurityException e) {
314 log.error("Message did not meet security requirements", e);
315 throw new ProfileException("Message did not meet security requirements", e);
320 * Creates an authentication request context from the current environmental information.
322 * @param loginContext current login context
323 * @param in inbound transport
324 * @param out outbount transport
326 * @return created authentication request context
328 * @throws ProfileException thrown if there is a problem creating the context
330 protected SSORequestContext buildRequestContext(Saml2LoginContext loginContext, HTTPInTransport in,
331 HTTPOutTransport out) throws ProfileException {
332 SSORequestContext requestContext = new SSORequestContext();
334 requestContext.setMessageDecoder(getMessageDecoders().get(getInboundBinding()));
336 requestContext.setLoginContext(loginContext);
337 requestContext.setPrincipalName(loginContext.getPrincipalName());
338 requestContext.setPrincipalAuthenticationMethod(loginContext.getAuthenticationMethod());
339 requestContext.setUserSession(getUserSession(in));
340 requestContext.setRelayState(loginContext.getRelayState());
342 requestContext.setInboundMessageTransport(in);
343 requestContext.setInboundSAMLProtocol(SAMLConstants.SAML20P_NS);
346 AuthnRequest authnRequest = loginContext.getAuthenticationRequest();
347 requestContext.setInboundMessage(authnRequest);
348 requestContext.setInboundSAMLMessage(loginContext.getAuthenticationRequest());
349 requestContext.setInboundSAMLMessageId(loginContext.getAuthenticationRequest().getID());
351 Subject authnSubject = authnRequest.getSubject();
352 if (authnSubject != null) {
353 requestContext.setSubjectNameIdentifier(authnSubject.getNameID());
355 } catch (UnmarshallingException e) {
356 log.error("Unable to unmarshall authentication request context");
357 requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, null,
358 "Error recovering request state"));
359 throw new ProfileException("Error recovering request state", e);
362 requestContext.setOutboundMessageTransport(out);
363 requestContext.setOutboundSAMLProtocol(SAMLConstants.SAML20P_NS);
365 MetadataProvider metadataProvider = getMetadataProvider();
366 requestContext.setMetadataProvider(metadataProvider);
368 String relyingPartyId = loginContext.getRelyingPartyId();
369 requestContext.setInboundMessageIssuer(relyingPartyId);
371 EntityDescriptor relyingPartyMetadata = metadataProvider.getEntityDescriptor(relyingPartyId);
372 if (relyingPartyMetadata != null) {
373 requestContext.setPeerEntityMetadata(relyingPartyMetadata);
374 requestContext.setPeerEntityRole(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
375 requestContext.setPeerEntityRoleMetadata(relyingPartyMetadata
376 .getSPSSODescriptor(SAMLConstants.SAML20P_NS));
378 } catch (MetadataProviderException e) {
379 log.error("Unable to locate metadata for relying party");
380 requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, null,
381 "Error locating relying party metadata"));
382 throw new ProfileException("Error locating relying party metadata");
385 RelyingPartyConfiguration rpConfig = getRelyingPartyConfiguration(relyingPartyId);
386 if (rpConfig == null) {
387 log.error("Unable to retrieve relying party configuration data for entity with ID {}", relyingPartyId);
388 throw new ProfileException("Unable to retrieve relying party configuration data for entity with ID "
391 requestContext.setRelyingPartyConfiguration(rpConfig);
393 SSOConfiguration profileConfig = (SSOConfiguration) rpConfig
394 .getProfileConfiguration(SSOConfiguration.PROFILE_ID);
395 requestContext.setProfileConfiguration(profileConfig);
396 requestContext.setOutboundMessageArtifactType(profileConfig.getOutboundArtifactType());
397 if (profileConfig.getSigningCredential() != null) {
398 requestContext.setOutboundSAMLMessageSigningCredential(profileConfig.getSigningCredential());
399 } else if (rpConfig.getDefaultSigningCredential() != null) {
400 requestContext.setOutboundSAMLMessageSigningCredential(rpConfig.getDefaultSigningCredential());
402 requestContext.setPeerEntityEndpoint(selectEndpoint(requestContext));
404 String assertingPartyId = rpConfig.getProviderId();
405 requestContext.setLocalEntityId(assertingPartyId);
408 EntityDescriptor localEntityDescriptor = metadataProvider.getEntityDescriptor(assertingPartyId);
409 if (localEntityDescriptor != null) {
410 requestContext.setLocalEntityMetadata(localEntityDescriptor);
411 requestContext.setLocalEntityRole(IDPSSODescriptor.DEFAULT_ELEMENT_NAME);
412 requestContext.setLocalEntityRoleMetadata(localEntityDescriptor
413 .getIDPSSODescriptor(SAMLConstants.SAML20P_NS));
415 } catch (MetadataProviderException e) {
416 log.error("Unable to locate metadata for asserting party");
417 requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, null,
418 "Error locating asserting party metadata"));
419 throw new ProfileException("Error locating asserting party metadata");
422 return requestContext;
426 * Creates an authentication statement for the current request.
428 * @param requestContext current request context
430 * @return constructed authentication statement
432 protected AuthnStatement buildAuthnStatement(SSORequestContext requestContext) {
433 Saml2LoginContext loginContext = requestContext.getLoginContext();
435 AuthnContext authnContext = buildAuthnContext(requestContext);
437 AuthnStatement statement = authnStatementBuilder.buildObject();
438 statement.setAuthnContext(authnContext);
439 statement.setAuthnInstant(loginContext.getAuthenticationInstant());
442 statement.setSessionIndex(null);
444 if (loginContext.getAuthenticationDuration() > 0) {
445 statement.setSessionNotOnOrAfter(loginContext.getAuthenticationInstant().plus(
446 loginContext.getAuthenticationDuration()));
449 statement.setSubjectLocality(buildSubjectLocality(requestContext));
455 * Creates an {@link AuthnContext} for a succesful authentication request.
457 * @param requestContext current request
459 * @return the built authn context
461 protected AuthnContext buildAuthnContext(SSORequestContext requestContext) {
462 AuthnContext authnContext = authnContextBuilder.buildObject();
464 Saml2LoginContext loginContext = requestContext.getLoginContext();
465 AuthnRequest authnRequest = requestContext.getInboundSAMLMessage();
466 RequestedAuthnContext requestedAuthnContext = authnRequest.getRequestedAuthnContext();
467 if (requestedAuthnContext != null) {
468 if (requestedAuthnContext.getAuthnContextClassRefs() != null) {
469 for (AuthnContextClassRef classRef : requestedAuthnContext.getAuthnContextClassRefs()) {
470 if (classRef.getAuthnContextClassRef().equals(loginContext.getAuthenticationMethod())) {
471 AuthnContextClassRef ref = authnContextClassRefBuilder.buildObject();
472 ref.setAuthnContextClassRef(loginContext.getAuthenticationMethod());
473 authnContext.setAuthnContextClassRef(ref);
476 } else if (requestedAuthnContext.getAuthnContextDeclRefs() != null) {
477 for (AuthnContextDeclRef declRef : requestedAuthnContext.getAuthnContextDeclRefs()) {
478 if (declRef.getAuthnContextDeclRef().equals(loginContext.getAuthenticationMethod())) {
479 AuthnContextDeclRef ref = authnContextDeclRefBuilder.buildObject();
480 ref.setAuthnContextDeclRef(loginContext.getAuthenticationMethod());
481 authnContext.setAuthnContextDeclRef(ref);
486 AuthnContextDeclRef ref = authnContextDeclRefBuilder.buildObject();
487 ref.setAuthnContextDeclRef(loginContext.getAuthenticationMethod());
488 authnContext.setAuthnContextDeclRef(ref);
495 * Constructs the subject locality for the authentication statement.
497 * @param requestContext curent request context
499 * @return subject locality for the authentication statement
501 protected SubjectLocality buildSubjectLocality(SSORequestContext requestContext) {
502 HTTPInTransport transport = (HTTPInTransport) requestContext.getInboundMessageTransport();
503 SubjectLocality subjectLocality = subjectLocalityBuilder.buildObject();
504 subjectLocality.setAddress(transport.getPeerAddress());
505 subjectLocality.setDNSName(transport.getPeerDomainName());
507 return subjectLocality;
511 * Selects the appropriate endpoint for the relying party and stores it in the request context.
513 * @param requestContext current request context
515 * @return Endpoint selected from the information provided in the request context
517 protected Endpoint selectEndpoint(SSORequestContext requestContext) {
518 AuthnResponseEndpointSelector endpointSelector = new AuthnResponseEndpointSelector();
519 endpointSelector.setEndpointType(AssertionConsumerService.DEFAULT_ELEMENT_NAME);
520 endpointSelector.setMetadataProvider(getMetadataProvider());
521 endpointSelector.setEntityMetadata(requestContext.getPeerEntityMetadata());
522 endpointSelector.setEntityRoleMetadata(requestContext.getPeerEntityRoleMetadata());
523 endpointSelector.setSamlRequest(requestContext.getInboundSAMLMessage());
524 endpointSelector.getSupportedIssuerBindings().addAll(getSupportedOutboundBindings());
525 return endpointSelector.selectEndpoint();
528 /** Represents the internal state of a SAML 2.0 SSO Request while it's being processed by the IdP. */
529 protected class SSORequestContext extends BaseSAML2ProfileRequestContext<AuthnRequest, Response, SSOConfiguration> {
531 /** Current login context. */
532 private Saml2LoginContext loginContext;
535 * Gets the current login context.
537 * @return current login context
539 public Saml2LoginContext getLoginContext() {
544 * Sets the current login context.
546 * @param context current login context
548 public void setLoginContext(Saml2LoginContext context) {
549 loginContext = context;