Package com.cloudseal.client.saml2

Examples of com.cloudseal.client.saml2.AuthResponseValidatorTests


    @Override
    @SuppressWarnings("unchecked")
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // Get the Cloudseal principal
        CloudsealPrincipal cloudsealPrincipal = CloudsealUtils.getPrincipal(req);

        resp.getWriter().println("<html><body>");
        resp.getWriter().println("<h3>User Properties</h3>");

        // Here we're using commons BeanUtils to create a map of all the properties on the CloudsealPrincipal
View Full Code Here


    @Override
    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        CloudsealAssertionAuthenticationToken token = (CloudsealAssertionAuthenticationToken) authentication;
        CloudsealAssertionAuthenticationToken.TokenDetails tokenDetails = (CloudsealAssertionAuthenticationToken.TokenDetails) token.getDetails();
        try {
            CloudsealPrincipal cloudsealPrincipal = responseValidator.validateResponse(cloudsealManager.getPublicKey(),
                    tokenDetails.getSamlResponse(), tokenDetails.getRequestId(), tokenDetails.getAudience());

            Collection<? extends GrantedAuthority> authorities = mapAuthorities(cloudsealPrincipal);
            CloudsealUserDetails userDetails = new CloudsealUserDetails(cloudsealPrincipal, authorities);
            CloudsealAuthenticationToken authenticationToken = new CloudsealAuthenticationToken(userDetails);
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // Get the Cloudseal principal
        CloudsealPrincipal cloudsealPrincipal = CloudsealUtils.getPrincipal(req);

        String contextRoot = req.getContextPath();
        resp.getWriter().println("<html><body>");
        resp.getWriter().println("<p><a href=\"" + contextRoot + "/logout\">logout</a></p>");
        resp.getWriter().println("<h3>User Properties</h3>");
View Full Code Here

*/
public class CloudsealDemoServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        CloudsealPrincipal principal = (CloudsealPrincipal) request.getUserPrincipal();
        request.setAttribute("username", principal.getUsername());
        request.setAttribute("firstName", principal.getFirstName());
        request.setAttribute("lastName", principal.getLastName());
        request.setAttribute("email", principal.getEmail());
        getServletContext().getRequestDispatcher("/WEB-INF/jsp/demo.jsp").forward(request, response);
    }
View Full Code Here

    private CloudsealManager cloudsealManager;
    private IdentifierGenerator identityGenerator;

    public CloudsealEntryPoint() {
        identityGenerator = new IdentifierGenerator();
    }
View Full Code Here

    private CloudsealManager cloudsealManager;
    private IdentifierGenerator identityGenerator;

    public CloudsealEntryPoint() {
        identityGenerator = new IdentifierGenerator();
    }
View Full Code Here

    private IdpXmlParser idpXmlParser;
    private AuthRequestBuilderImpl authRequestBuilder;

    public CloudsealManagerImpl() {
        idpXmlParser = new IdpXmlParser();
        authRequestBuilder = new AuthRequestBuilderImpl();
    }
View Full Code Here

    private IdpXmlParser idpXmlParser;
    private SamlBuilder authRequestBuilder;

    public CloudsealManagerImpl() {
        idpXmlParser = new IdpXmlParser();
        authRequestBuilder = new SamlBuilderImpl();
    }
View Full Code Here

    private IdpXmlParser idpXmlParser;
    private AuthRequestBuilder authRequestBuilder;

    public CloudsealManagerImpl() {
        idpXmlParser = new IdpXmlParser();
        authRequestBuilder = new AuthRequestBuilder();
    }
View Full Code Here

    private IdpXmlParser idpXmlParser;
    private SamlBuilder authRequestBuilder;

    public CloudsealManagerImpl() {
        idpXmlParser = new IdpXmlParser();
        authRequestBuilder = new SamlBuilderImpl();
    }
View Full Code Here

TOP

Related Classes of com.cloudseal.client.saml2.AuthResponseValidatorTests

Copyright © 2018 www.massapicom. 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.