private EnforcementFacade getEnforcmentFacade() { EnforcementFacade facade = null; EnforcementPointConfig enforcementPoint = getSecurityServiceConfig() .getEnforcementPointConfig(getEnforcementPointId()); List interceptorList = new ArrayList(); for (Iterator i = enforcementPoint.getInterceptors(); i.hasNext();) { interceptorList.add(i.next()); } String protectedServiceURL = enforcementPoint.getEndpoint(); AuthenticationService authnService = getSecurityServiceConfig() .getAuthenticationService(); try { facade = new EnforcementFacade(protectedServiceURL, authnService, interceptorList); } catch (Exception e) { sLogger.debug("Failed to create EnforcementFacade, e"); } return facade; }
STSAuthenticationService stsAuthService = (STSAuthenticationService) securityConfig .getServiceConfig(STSAuthenticationService.SERVICENAME).getInstance(); AuthenticationService authenticationService = securityConfig.getServiceConfig(STSAuthenticationService.SERVICENAME).getAuthenticationService(); CredentialsCallbackHandler ccbh = new CredentialsCallbackHandler(); ccbh.add(new UsernamePasswordCredential(token.getName(), token
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException, AuthenticationException { for (int i = 0; i < callbacks.length; i++) { WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i]; MessageContext currentMessageContext = MessageContext.getCurrentMessageContext(); String id = pwcb.getIdentifer(); if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) { String password = pwcb.getPassword(); CredentialsCallbackHandler ccbh = new CredentialsCallbackHandler(); ccbh.add(new UsernamePasswordCredential(id, password)); if (m_securityConfig == null) { throw new AxisFault("No SecurityConfiguration found"); } if (getSecurityServiceConfig() == null) { throw new AxisFault("No ServiceConfiguration " + "found, please configure it appropriately."); } AuthenticationService auth = getSecurityServiceConfig() .getAuthenticationService(); auth.login(ccbh); } if (pwcb.getUsage() == WSPasswordCallback.SIGNATURE) { } } }