Package org.openid4java.consumer

Examples of org.openid4java.consumer.ConsumerManager.verify()


        ConsumerManager mgr = mock(ConsumerManager.class);
        OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(mgr, new NullAxFetchListFactory());
        VerificationResult vr = mock(VerificationResult.class);
        DiscoveryInformation di = mock(DiscoveryInformation.class);

        when(mgr.verify(anyString(), any(ParameterList.class), any(DiscoveryInformation.class))).thenReturn(vr);

        MockHttpServletRequest request = new MockHttpServletRequest();

        request.getSession().setAttribute(DiscoveryInformation.class.getName(), di);
View Full Code Here


    @Test
    public void verificationExceptionsRaiseOpenIDException() throws Exception {
        ConsumerManager mgr = mock(ConsumerManager.class);
        OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(mgr, new NullAxFetchListFactory());

        when(mgr.verify(anyString(), any(ParameterList.class), any(DiscoveryInformation.class)))
                .thenThrow(new MessageException(""))
                .thenThrow(new AssociationException(""))
                .thenThrow(new DiscoveryException(""));

        MockHttpServletRequest request = new MockHttpServletRequest();
View Full Code Here

                return "id";
            }
        };
        Message msg = mock(Message.class);

        when(mgr.verify(anyString(), any(ParameterList.class), any(DiscoveryInformation.class))).thenReturn(vr);
        when(vr.getVerifiedId()).thenReturn(id);
        when(vr.getAuthResponse()).thenReturn(msg);

        MockHttpServletRequest request = new MockHttpServletRequest();
View Full Code Here

            log.info("OpenID disc : " + discovered.getOPEndpoint());
            log.info("OpenID orig ref : " + getOriginalRef());
            ConsumerManager manager = getManager(discovered.getOPEndpoint()
                    .toString());

            VerificationResult verification = manager.verify(getOriginalRef()
                    .toString(), response, discovered);
            log.info("verification = " + verification);

            // examine the verification result and extract the verified
            // identifier
View Full Code Here

            ConsumerManager manager = getManager(discovered.getOPEndpoint()
                    .toString());
            String redir = request.getResourceRef().getHostIdentifier()
                    + request.getResourceRef().getPath() + "?return=true";

            VerificationResult verification = manager.verify(redir, response,
                    discovered);

            // examine the verification result and extract the verified
            // identifier
            Identifier verified = verification.getVerifiedId();
View Full Code Here

      // Verify the response
      // ConsumerManager needs to be the same (static) instance used
      // to place the authentication request
      // This could be tricky if this service is load-balanced
      VerificationResult verification = consumerManager.verify(
        receivingURL.toString(),
        parameterList,
        discovered);

      // Examine the verification result and extract the verified identifier
View Full Code Here

                receivingURL.append("?").append(httpRequest.getQueryString());
            }
            // verify the response
            VerificationResult verification = null;
            log.info("Receiving URL = " + receivingURL.toString());
            verification = manager.verify(receivingURL.toString(), openidResp, discovered);
            // examine the verification result and extract the verified identifier
            Identifier verified = verification.getVerifiedId();
            if (verified != null) {
                AuthSuccess authSuccess = (AuthSuccess) verification.getAuthResponse();
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.