@Test public void testForce() throws Exception { options.setForceAuthN(true); storage.storeMessage((String) notNull(), (XMLObject) notNull()); replyMock(); profile.sendAuthenticationRequest(samlContext, options, storage); AuthnRequest authnRequest = (AuthnRequest) samlContext.getOutboundSAMLMessage(); verifyMock(); assertEquals(true, authnRequest.isForceAuthn()); assertEquals(false, authnRequest.isPassive()); assertTrue(authnRequest.getScoping().getProxyCount() > 0); }
public void sendAuthenticationRequest(SAMLMessageContext context, WebSSOProfileOptions options, SAMLMessageStorage messageStorage) throws SAMLException, MetadataProviderException, MessageEncodingException { if (!SPSSODescriptor.DEFAULT_ELEMENT_NAME.equals(context.getLocalEntityRole())) { throw new SAMLException("WebSSO can only be initialized for local SP, but localEntityRole is: " + context.getLocalEntityRole()); } String idpId = options.getIdp(); if (idpId == null) { idpId = metadata.getDefaultIDP(); } SPSSODescriptor spDescriptor = (SPSSODescriptor) context.getLocalEntityRoleMetadata(); IDPSSODescriptor idpssoDescriptor = getIDPDescriptor(idpId); ExtendedMetadata idpExtendedMetadata = metadata.getExtendedMetadata(idpId); SingleSignOnService ssoService = getSingleSignOnService(idpssoDescriptor, spDescriptor, options); AssertionConsumerService consumerService = getAssertionConsumerService(idpssoDescriptor, spDescriptor, options, null); AuthnRequest authRequest = getAuthnRequest(context, options, consumerService, ssoService); context.setCommunicationProfileId(ssoService.getBinding()); context.setOutboundMessage(authRequest); context.setOutboundSAMLMessage(authRequest); context.setPeerEntityEndpoint(ssoService); context.setPeerEntityId(idpssoDescriptor.getID()); context.setPeerEntityRoleMetadata(idpssoDescriptor); context.setPeerExtendedMetadata(idpExtendedMetadata); boolean sign = spDescriptor.isAuthnRequestsSigned() || idpssoDescriptor.getWantAuthnRequestsSigned(); sendMessage(context, sign); messageStorage.storeMessage(authRequest.getID(), authRequest); }
WebSSOProfileImpl extends AbstractProfileBase implements WebSSOProfile { public void sendAuthenticationRequest(SAMLMessageContext context, WebSSOProfileOptions options, SAMLMessageStorage messageStorage) throws SAMLException, MetadataProviderException, MessageEncodingException { if (!SPSSODescriptor.DEFAULT_ELEMENT_NAME.equals(context.getLocalEntityRole())) { throw new SAMLException("WebSSO can only be initialized for local SP, but localEntityRole is: " + context.getLocalEntityRole()); } String idpId = options.getIdp(); if (idpId == null) { idpId = metadata.getDefaultIDP(); } SPSSODescriptor spDescriptor = (SPSSODescriptor) context.getLocalEntityRoleMetadata(); IDPSSODescriptor idpssoDescriptor = getIDPDescriptor(idpId); ExtendedMetadata idpExtendedMetadata = metadata.getExtendedMetadata(idpId); SingleSignOnService ssoService = getSingleSignOnService(idpssoDescriptor, spDescriptor, options); AssertionConsumerService consumerService = getAssertionConsumerService(idpssoDescriptor, spDescriptor, options, null); AuthnRequest authRequest = getAuthnRequest(context, options, consumerService, ssoService); context.setCommunicationProfileId(ssoService.getBinding()); context.setOutboundMessage(authRequest); context.setOutboundSAMLMessage(authRequest); context.setPeerEntityEndpoint(ssoService); context.setPeerEntityId(idpssoDescriptor.getID()); context.setPeerEntityRoleMetadata(idpssoDescriptor); context.setPeerExtendedMetadata(idpExtendedMetadata); boolean sign = spDescriptor.isAuthnRequestsSigned() || idpssoDescriptor.getWantAuthnRequestsSigned(); sendMessage(context, sign); messageStorage.storeMessage(authRequest.getID(), authRequest); } }
WebSSOProfileImpl extends AbstractProfileBase implements WebSSOProfile { public void sendAuthenticationRequest(SAMLMessageContext context, WebSSOProfileOptions options, SAMLMessageStorage messageStorage) throws SAMLException, MetadataProviderException, MessageEncodingException { if (!SPSSODescriptor.DEFAULT_ELEMENT_NAME.equals(context.getLocalEntityRole())) { throw new SAMLException("WebSSO can only be initialized for local SP, but localEntityRole is: " + context.getLocalEntityRole()); } String idpId = options.getIdp(); if (idpId == null) { idpId = metadata.getDefaultIDP(); } SPSSODescriptor spDescriptor = (SPSSODescriptor) context.getLocalEntityRoleMetadata(); IDPSSODescriptor idpssoDescriptor = getIDPDescriptor(idpId); ExtendedMetadata idpExtendedMetadata = metadata.getExtendedMetadata(idpId); SingleSignOnService ssoService = getSingleSignOnService(idpssoDescriptor, spDescriptor, options); AssertionConsumerService consumerService = getAssertionConsumerService(idpssoDescriptor, spDescriptor, options, null); AuthnRequest authRequest = getAuthnRequest(context, options, consumerService, ssoService); context.setCommunicationProfileId(ssoService.getBinding()); context.setOutboundMessage(authRequest); context.setOutboundSAMLMessage(authRequest); context.setPeerEntityEndpoint(ssoService); context.setPeerEntityId(idpssoDescriptor.getID()); context.setPeerEntityRoleMetadata(idpssoDescriptor); context.setPeerExtendedMetadata(idpExtendedMetadata); boolean sign = spDescriptor.isAuthnRequestsSigned() || idpssoDescriptor.getWantAuthnRequestsSigned(); sendMessage(context, sign); messageStorage.storeMessage(authRequest.getID(), authRequest); } WebSSOProfileImpl();  WebSSOProfileImpl(SAMLProcessor processor, MetadataManager manager); }
WebSSOProfileImpl extends AbstractProfileBase implements WebSSOProfile { public void sendAuthenticationRequest(SAMLMessageContext context, WebSSOProfileOptions options, SAMLMessageStorage messageStorage) throws SAMLException, MetadataProviderException, MessageEncodingException { if (!SPSSODescriptor.DEFAULT_ELEMENT_NAME.equals(context.getLocalEntityRole())) { throw new SAMLException("WebSSO can only be initialized for local SP, but localEntityRole is: " + context.getLocalEntityRole()); } String idpId = options.getIdp(); if (idpId == null) { idpId = metadata.getDefaultIDP(); } SPSSODescriptor spDescriptor = (SPSSODescriptor) context.getLocalEntityRoleMetadata(); IDPSSODescriptor idpssoDescriptor = getIDPDescriptor(idpId); ExtendedMetadata idpExtendedMetadata = metadata.getExtendedMetadata(idpId); SingleSignOnService ssoService = getSingleSignOnService(idpssoDescriptor, spDescriptor, options); AssertionConsumerService consumerService = getAssertionConsumerService(idpssoDescriptor, spDescriptor, options, null); AuthnRequest authRequest = getAuthnRequest(context, options, consumerService, ssoService); context.setCommunicationProfileId(ssoService.getBinding()); context.setOutboundMessage(authRequest); context.setOutboundSAMLMessage(authRequest); context.setPeerEntityEndpoint(ssoService); context.setPeerEntityId(idpssoDescriptor.getID()); context.setPeerEntityRoleMetadata(idpssoDescriptor); context.setPeerExtendedMetadata(idpExtendedMetadata); boolean sign = spDescriptor.isAuthnRequestsSigned() || idpssoDescriptor.getWantAuthnRequestsSigned(); sendMessage(context, sign); messageStorage.storeMessage(authRequest.getID(), authRequest); } WebSSOProfileImpl();  WebSSOProfileImpl(SAMLProcessor processor, MetadataManager manager); void sendAuthenticationRequest(SAMLMessageContext context, WebSSOProfileOptions options, SAMLMessageStorage messageStorage); }
WebSSOProfileImpl extends AbstractProfileBase implements WebSSOProfile { public void sendAuthenticationRequest(SAMLMessageContext context, WebSSOProfileOptions options, SAMLMessageStorage messageStorage) throws SAMLException, MetadataProviderException, MessageEncodingException { if (!SPSSODescriptor.DEFAULT_ELEMENT_NAME.equals(context.getLocalEntityRole())) { throw new SAMLException("WebSSO can only be initialized for local SP, but localEntityRole is: " + context.getLocalEntityRole()); } String idpId = options.getIdp(); if (idpId == null) { idpId = metadata.getDefaultIDP(); } SPSSODescriptor spDescriptor = (SPSSODescriptor) context.getLocalEntityRoleMetadata(); IDPSSODescriptor idpssoDescriptor = getIDPDescriptor(idpId); ExtendedMetadata idpExtendedMetadata = metadata.getExtendedMetadata(idpId); SingleSignOnService ssoService = getSingleSignOnService(idpssoDescriptor, spDescriptor, options); AssertionConsumerService consumerService = getAssertionConsumerService(idpssoDescriptor, spDescriptor, options, null); AuthnRequest authRequest = getAuthnRequest(context, options, consumerService, ssoService); context.setCommunicationProfileId(ssoService.getBinding()); context.setOutboundMessage(authRequest); context.setOutboundSAMLMessage(authRequest); context.setPeerEntityEndpoint(ssoService); context.setPeerEntityId(idpssoDescriptor.getID()); context.setPeerEntityRoleMetadata(idpssoDescriptor); context.setPeerExtendedMetadata(idpExtendedMetadata); boolean sign = spDescriptor.isAuthnRequestsSigned() || idpssoDescriptor.getWantAuthnRequestsSigned(); sendMessage(context, sign); messageStorage.storeMessage(authRequest.getID(), authRequest); } WebSSOProfileImpl();  WebSSOProfileImpl(SAMLProcessor processor, MetadataManager manager); void sendAuthenticationRequest(SAMLMessageContext context, WebSSOProfileOptions options, SAMLMessageStorage messageStorage);  }