Examples of Association


Examples of org.openid4java.association.Association

            {
                if (DEBUG) _log.debug("Found matching service: " + service);
                firstServiceMatch = service;
            }

            Association assoc = _associations.load(
                    service.getOPEndpoint().toString(),
                    authResp.getHandle());

            // don't look further if there is an association with this endpoint
            if (assoc != null)
View Full Code Here

Examples of org.openid4java.association.Association

            _discovery.parseIdentifier(authResp.getClaimed()) : //may have frag
            discovered.getClaimedIdentifier(); //assert id may be delegate in v1

        String handle = authResp.getHandle();
        URL op = discovered.getOPEndpoint();
        Association assoc = _associations.load(op.toString(), handle);

        if (assoc != null) // association available, local verification
        {
            _log.info("Found association: " + assoc.getHandle() +
                      " verifying signature locally...");
            String text = authResp.getSignedText();
            String signature = authResp.getSignature();

            if (assoc.verifySignature(text, signature))
            {
                result.setVerifiedId(claimedId);
                if (DEBUG) _log.debug("Local signature verification succeeded.");
            }
            else if (DEBUG)
View Full Code Here

Examples of org.openid4java.association.Association

                        + type.getSessionType() + " / "
                        + type.getAssociationType() );
            }
            else // all ok, go ahead
            {
                Association assoc = _sharedAssociations.generate(
                        type.getAssociationType(), _expireIn);

                _log.info("Returning shared association; handle: " + assoc.getHandle());

                return AssociationResponse.createAssociationResponse(assocReq, assoc);
            }
        }
        catch (OpenIDException e)
        {
            // association failed, respond accordingly
            if (isVersion2)
            {
                _log.warn("Cannot establish association, " +
                           "responding with an OpenID2 association error.", e);

                return AssociationError.createAssociationError(
                        e.getMessage(), _prefAssocSessEnc);
            }
            else
            {
                _log.warn("Error processing an OpenID1 association request: " +
                          e.getMessage() +
                          " Responding with a dummy association.", e);
                try
                {
                    // generate dummy association & no-encryption response
                    // for compatibility mode
                    Association dummyAssoc = _sharedAssociations.generate(
                            Association.TYPE_HMAC_SHA1, 0);

                    AssociationRequest dummyRequest =
                            AssociationRequest.createAssociationRequest(
                            AssociationSessionType.NO_ENCRYPTION_COMPAT_SHA1MAC);
View Full Code Here

Examples of org.openid4java.association.Association

            if (DEBUG) _log.debug("Using ClaimedID: " + claimed +
                                  " OP-specific ID: " + id);

            if (authenticatedAndApproved) // positive response
            {
                Association assoc = null;
                String handle = authReq.getHandle();
                String invalidateHandle = null;

                if (handle != null)
                {
                    assoc = _sharedAssociations.load(handle);
                    if (assoc == null)
                    {
                        _log.info("Invalidating handle: " + handle);
                        invalidateHandle = handle;
                    }
                    else
                        _log.info("Loaded shared association; handle: " + handle);
                }

                if (assoc == null)
                {
                    assoc = _privateAssociations.generate(
                            _prefAssocSessEnc.getAssociationType(),
                            _expireIn);

                    _log.info("Generated private association; handle: "
                              + assoc.getHandle());
                }

                AuthSuccess response = AuthSuccess.createAuthSuccess(
                            opEndpoint, claimed, id, !isVersion2,
                            authReq.getReturnTo(),
                            isVersion2 ? _nonceGenerator.next() : null,
                            invalidateHandle, assoc, false);

                if (_signFields != null)
                    response.setSignFields(_signFields);

                if (_signExtensions != null)
                    response.setSignExtensions(_signExtensions);

                if (signNow)
                    response.setSignature(assoc.sign(response.getSignedText()));

                _log.info("Returning positive assertion for " +
                          response.getReturnTo());

                return response;
View Full Code Here

Examples of org.openid4java.association.Association

        throws ServerException, AssociationException
    {
        String handle = authSuccess.getHandle();

        // try shared associations first, then private
        Association assoc = _sharedAssociations.load(handle);

        if (assoc == null)
            assoc = _privateAssociations.load(handle);

        if (assoc == null) throw new ServerException(
                "No association found for handle: " + handle);

        authSuccess.setSignature(assoc.sign(authSuccess.getSignedText()));
    }
View Full Code Here

Examples of org.openid4java.association.Association

            isVersion2 = vrfyReq.isVersion2();
            String handle = vrfyReq.getHandle();

            boolean verified = false;

            Association assoc = _privateAssociations.load(handle);
            if (assoc != null) // verify the signature
            {
                _log.info("Loaded private association; handle: " + handle);

                verified = assoc.verifySignature(
                        vrfyReq.getSignedText(),
                        vrfyReq.getSignature());

                // remove the association so that the request
                // cannot be verified more than once
View Full Code Here

Examples of org.openid4java.association.Association

    public abstract ServerAssociationStore createStore();

    public void testGenerate() throws AssociationException
    {
        Association association = _associationStore.generate(Association.TYPE_HMAC_SHA1, 60);

        assertNotNull(association);

        assertSame(association, _associationStore.load(association.getHandle()));

        association = _associationStore.generate(Association.TYPE_HMAC_SHA256, 60);

        assertNotNull(association);

        assertSame(association, _associationStore.load(association.getHandle()));
    }
View Full Code Here

Examples of org.qi4j.api.association.Association

        Iterable<? extends AssociationDescriptor> associations = stateDescriptor.associations();
        for( AssociationDescriptor association : associations )
        {
            if( association.isAggregated() )
            {
                Association assoc = state.associationFor( association.accessor() );
                Object aggregatedEntity = assoc.get();
                if( aggregatedEntity != null )
                {
                    aggregatedEntities.add( aggregatedEntity );
                }
            }
View Full Code Here

Examples of org.sonar.server.qualitygate.QgateProjectFinder.Association

  }

  @Test
  public void search_with_query() throws Exception {
    long gateId = 12345L;
    Association assoc = mock(Association.class);
    when(assoc.hasMoreResults()).thenReturn(true);
    List<ProjectQgateAssociation> projects = ImmutableList.of(
      new ProjectQgateAssociation().setId(42L).setName("Project One").setMember(false),
      new ProjectQgateAssociation().setId(24L).setName("Project Two").setMember(true)
      );
    when(assoc.projects()).thenReturn(projects);
    when(projectFinder.find(any(ProjectQgateAssociationQuery.class))).thenReturn(assoc);

    tester.newGetRequest("api/qualitygates", "search")
      .setParam("gateId", Long.toString(gateId))
      .setParam("query", "Project")
View Full Code Here

Examples of org.tinyuml.draw.Association

    ClassElement class2 = factory.createClass();

    mockElementFactory.expects(atLeastOnce()).method("create").
      with(eq(ElementType.DEPENDENCY)).will(returnValue(assoc));

    Association conn = (Association) factory.createAssociation(class1, class2);
    assertEquals(assoc, conn.getModelElement());
    assertEquals(class1, conn.getNode0());
    assertEquals(class2, conn.getNode1());
    assertNull(conn.getParent());   
  }
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.