Examples of AssociationException


Examples of org.openid4java.association.AssociationException

            // is supported / allowed ?
            if (! Association.isHmacSupported(type.getAssociationType()) ||
                    ! DiffieHellmanSession.isDhSupported(type) ||
                    _minAssocSessEnc.isBetter(type))
            {
                throw new AssociationException("Unable create association for: "
                        + type.getSessionType() + " / "
                        + type.getAssociationType() );
            }
            else // all ok, go ahead
            {
View Full Code Here

Examples of org.openid4java.association.AssociationException

        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();
        request.setQueryString("x=5");
View Full Code Here

Examples of org.openid4java.association.AssociationException

            // is supported / allowed ?
            if (!Association.isHmacSupported(type.getAssociationType())
                    || !DiffieHellmanSession.isDhSupported(type)
                    || getMinAssocSessEnc().isBetter(type)) {
                throw new AssociationException("Unable create association for: "
                        + type.getSessionType() + " / " + type.getAssociationType());
            } else {
                Association assoc = getPrivateAssociations().generate(type.getAssociationType(),
                        getExpireIn());
                return AssociationResponse.createAssociationResponse(assocReq, assoc);
View Full Code Here

Examples of org.openid4java.association.AssociationException

            }

            attemptsLeft--;
        }

        throw new AssociationException(
                "JDBCServerAssociationStore: Error generating association.");
    }
View Full Code Here

Examples of org.openid4java.association.AssociationException

            String type = (String) res.get("type");
            String macKey = (String) res.get("mackey");
            Date expDate = (Date) res.get("expdate");

            if (type == null || macKey == null || expDate == null)
                throw new AssociationException("Invalid association data " +
                        "retrived from database; cannot create Association " +
                        "object for handle: " + handle);

            Association assoc;

            if (Association.TYPE_HMAC_SHA1.equals(type))
                assoc = Association.createHmacSha1(handle,
                        Base64.decodeBase64(macKey.getBytes() ), expDate);

            else if (Association.TYPE_HMAC_SHA256.equals(type))
                assoc = Association.createHmacSha256(handle,
                        Base64.decodeBase64(macKey.getBytes() ), expDate);

            else
                throw new AssociationException("Invalid association type " +
                        "retrieved from database: " + type);

            if (DEBUG)
                _log.debug("Retrieved association from database, handle: " + handle);
View Full Code Here

Examples of org.openid4java.association.AssociationException

            // is supported / allowed ?
            if (! Association.isHmacSupported(type.getAssociationType()) ||
                    ! DiffieHellmanSession.isDhSupported(type) ||
                    _minAssocSessEnc.isBetter(type))
            {
                throw new AssociationException("Unable create association for: "
                        + type.getSessionType() + " / "
                        + type.getAssociationType() );
            }
            else // all ok, go ahead
            {
View Full Code Here

Examples of org.openid4java.association.AssociationException

            }

            attemptsLeft--;
        }

        throw new AssociationException(
                "JDBCServerAssociationStore: Error generating association.");
    }
View Full Code Here

Examples of org.openid4java.association.AssociationException

        else if (Association.TYPE_HMAC_SHA256.equals(type.getAssociationType()))
            assoc = Association.createHmacSha256(handle, macKey, expiresIn);

        else
            throw new AssociationException("Unknown association type: " + type);

        if (DEBUG) _log.debug("Created association for handle: " + handle);

        return assoc;
    }
View Full Code Here

Examples of org.openid4java.association.AssociationException

            String type = (String) res.get("type");
            String macKey = (String) res.get("mackey");
            Date expDate = (Date) res.get("expdate");

            if (type == null || macKey == null || expDate == null)
                throw new AssociationException("Invalid association data " +
                        "retrived from database; cannot create Association " +
                        "object for handle: " + handle);

            Association assoc;

            if (Association.TYPE_HMAC_SHA1.equals(type))
                assoc = Association.createHmacSha1(handle,
                        Base64.decodeBase64(macKey.getBytes() ), expDate);

            else if (Association.TYPE_HMAC_SHA256.equals(type))
                assoc = Association.createHmacSha256(handle,
                        Base64.decodeBase64(macKey.getBytes() ), expDate);

            else
                throw new AssociationException("Invalid association type " +
                        "retrieved from database: " + type);

            if (DEBUG)
                _log.debug("Retrieved association from database, handle: " + handle);
View Full Code Here

Examples of org.openid4java.association.AssociationException

            // is supported / allowed ?
            if (! Association.isHmacSupported(type.getAssociationType()) ||
                    ! DiffieHellmanSession.isDhSupported(type) ||
                    _minAssocSessEnc.isBetter(type))
            {
                throw new AssociationException("Unable create association for: "
                        + type.getSessionType() + " / "
                        + type.getAssociationType() );
            }
            else // all ok, go ahead
            {
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.