Examples of UsernamePasswordCallbackHandler


Examples of org.apache.wss4j.dom.common.UsernamePasswordCallbackHandler

            LOG.debug(outputString);
        }
       
        WSSConfig wssConfig = WSSConfig.getNewInstance();
        RequestData data = new RequestData();
        data.setCallbackHandler(new UsernamePasswordCallbackHandler());
        data.setWssConfig(wssConfig);
       
        // Successfully verify UsernameToken
        verify(signedDoc, wssConfig, data);
       
View Full Code Here

Examples of org.apache.wss4j.dom.common.UsernamePasswordCallbackHandler

        }
       
        // The default behaviour is that password verification will fail
        WSSConfig wssConfig = WSSConfig.getNewInstance();
        try {
            verify(signedDoc, wssConfig, new UsernamePasswordCallbackHandler(), null);
            fail("Failure expected on a bad password text");
        } catch (WSSecurityException ex) {
            assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
            // expected
        }
       
        // Now switch out the default UsernameToken validator
        wssConfig.setValidator(WSSecurityEngine.USERNAME_TOKEN, NoOpValidator.class);
        verify(signedDoc, wssConfig, new UsernamePasswordCallbackHandler(), null);
    }
View Full Code Here

Examples of org.fcrepo.server.security.jaas.auth.handler.UsernamePasswordCallbackHandler

        }

        LoginContext loginContext = null;
        try {
            CallbackHandler handler =
                    new UsernamePasswordCallbackHandler(username, password);
            loginContext = new LoginContext(jaasConfigName, handler);
            loginContext.login();
        } catch (LoginException le) {
            logger.error(le.toString());
            return null;
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.