Examples of FederationResponse


Examples of org.apache.cxf.fediz.core.FederationResponse

    private FederationAuthenticationToken authenticateNow(final Authentication authentication)
        throws AuthenticationException {
        try {
            FederationRequest wfReq = (FederationRequest)authentication.getCredentials();
            FederationProcessor wfProc = new FederationProcessorImpl();
            FederationResponse wfRes = wfProc.processRequest(wfReq, federationConfig.getFederationContext());

            final UserDetails userDetails = loadUserByFederationResponse(wfRes);
            userDetailsChecker.check(userDetails);
            return new FederationAuthenticationToken(userDetails, authentication.getCredentials(),
                    userDetails.getAuthorities(), userDetails, wfRes);
View Full Code Here

Examples of org.apache.cxf.fediz.core.FederationResponse

     */
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {

        try {
            FederationResponse fedResponse = null;
            Subject subject = WSSubject.getCallerSubject();
            boolean validSecurityTokenFound = false;
            if (subject != null) {
                fedResponse = getCachedFederationResponse(subject);
                validSecurityTokenFound = checkSecurityToken(fedResponse);
            }
            if (!validSecurityTokenFound) {
                if (LOG.isInfoEnabled()) {
                    LOG.info("Security token not found or WS-Federation session has expired");
                }
                // delete the session
                if (request instanceof HttpServletRequest) {
                    HttpServletRequest req = (HttpServletRequest)request;
                    req.getSession().invalidate();
                }
            } else {
                Element el = (Element)fedResponse.getToken();
                if (el != null) {
                    SecurityTokenThreadLocal.setToken(el);
                }
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Security token is still valid. Forwarding request");
View Full Code Here

Examples of org.apache.cxf.fediz.core.FederationResponse

        FederationRequest wfReq = new FederationRequest();
        wfReq.setWa(FederationConstants.ACTION_SIGNIN);
        wfReq.setWresult(wresult);

        FederationProcessor wfProc = new FederationProcessorImpl();
        FederationResponse wfResp = wfProc.processRequest(wfReq, fedContext);

        fedContext.close();

        Element e = wfResp.getToken();
       
        // Create new Security token with new id.
        // Parameters for freshness computation are copied from original IDP_TOKEN
        String id = "_" + UUIDGenerator.getUUID();
        SecurityToken idpToken = new SecurityToken(id,
            wfResp.getTokenCreated(), wfResp.getTokenExpires());

        idpToken.setToken(e);
        LOG.info("[IDP_TOKEN=" + id + "] for user '" + wfResp.getUsername()
                + "' created from [RP_TOKEN=" + wfResp.getUniqueTokenId()
                + "] issued by home realm [" + whr + "/"
                + wfResp.getIssuer() + "].");
        if (LOG.isDebugEnabled()) {
            LOG.debug("Created date=" + wfResp.getTokenCreated());
            LOG.debug("Expired date=" + wfResp.getTokenExpires());
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug("Validated 'wresult' : "
                    + System.getProperty("line.separator") + wresult);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.