ProxySAMLEntryPoint extends SAMLEntryPoint { @Override protected WebSSOProfileOptions getProfileOptions(SAMLMessageContext context, AuthenticationException exception) throws MetadataProviderException { WebSSOProfileOptions profileOptions = super.getProfileOptions(context, exception); String clientId = (String) context.getInboundMessageTransport().getAttribute(CLIENT_DETAILS); boolean clientIdCall = StringUtils.hasText(clientId); String relayState = clientIdCall ? clientId : context.getLocalEntityId(); profileOptions.setRelayState(relayState); Boolean forceAuthn = (Boolean) context.getInboundMessageTransport().getAttribute(FORCE_AUTHN); if (forceAuthn != null && forceAuthn) { profileOptions.setForceAuthN(true); } String idpSingleSignOn = (String) context.getInboundMessageTransport().getAttribute(IDP_SINGLE_SIGN_ON); if (StringUtils.hasText(idpSingleSignOn)) { profileOptions = new ExtendedWebSSOProfileOptions(profileOptions, idpSingleSignOn); } if (clientIdCall) { profileOptions.setIncludeScoping(true); String spEntityId = serviceProviderTranslationService.translateClientId(clientId); profileOptions.setRequesterIds(new HashSet<>(Arrays.asList(spEntityId))); } return profileOptions; }  @Override void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e); void setServiceProviderTranslationService(ServiceProviderTranslationService
                                                             serviceProviderTranslationService); void setClientDetailsEntityService(ClientDetailsEntityService clientDetailsEntityService);  }
@Test public void testGetProfileOptions() throws Exception { SAMLMessageContext context = mock(SAMLMessageContext.class); InTransport inTransport = mock(InTransport.class); when(context.getInboundMessageTransport()).thenReturn(inTransport); when(inTransport.getAttribute(CLIENT_DETAILS)).thenReturn(CLIENT_ID); WebSSOProfileOptions profileOptions = entryPoint.getProfileOptions(context, null); String relayState = profileOptions.getRelayState(); assertEquals(relayState, CLIENT_ID); Set<String> requesterIds = profileOptions.getRequesterIds(); assertEquals(new HashSet<>(Arrays.asList(SP_ENTITY_ID)), requesterIds); assertTrue(profileOptions.isIncludeScoping()); }