Package org.mitre.openid.connect.model

Examples of org.mitre.openid.connect.model.PairwiseIdentifier


      sectorIdentifier = uri.getHost(); // calculate based on the host of the only redirect URI
    }

    if (sectorIdentifier != null) {
      // if there's a sector identifier, use that for the lookup
      PairwiseIdentifier pairwise = pairwiseIdentifierRepository.getBySectorIdentifier(userInfo.getSub(), sectorIdentifier);

      if (pairwise == null) {
        // we don't have an identifier, need to make and save one

        pairwise = new PairwiseIdentifier();
        pairwise.setIdentifier(UUID.randomUUID().toString());
        pairwise.setUserSub(userInfo.getSub());
        pairwise.setSectorIdentifier(sectorIdentifier);

        pairwiseIdentifierRepository.save(pairwise);
      }

      return pairwise.getIdentifier();
    } else {

      return null;
    }
  }
View Full Code Here


    pairwiseClient5.setClientId(pairwiseClientId5);
    pairwiseClient5.setSubjectType(SubjectType.PAIRWISE);
    pairwiseClient5.setRedirectUris(pairwiseClient5RedirectUris);

    // saved pairwise identifier from repository
    savedPairwiseIdentifier = new PairwiseIdentifier();
    savedPairwiseIdentifier.setUserSub(regularSub);
    savedPairwiseIdentifier.setIdentifier(pairwiseSub);
    savedPairwiseIdentifier.setSectorIdentifier(sectorHost12);

  }
View Full Code Here

  public void testGetIdentifier_newEqual() {

    String pairwise1 = service.getIdentifier(userInfoRegular, pairwiseClient1);
    Mockito.verify(pairwiseIdentifierRepository, Mockito.atLeast(1)).save(Matchers.any(PairwiseIdentifier.class));

    PairwiseIdentifier pairwiseId = new PairwiseIdentifier();
    pairwiseId.setUserSub(regularSub);
    pairwiseId.setIdentifier(pairwise1);
    pairwiseId.setSectorIdentifier(sectorHost12);

    Mockito.when(pairwiseIdentifierRepository.getBySectorIdentifier(regularSub, sectorHost12)).thenReturn(pairwiseId);

    String pairwise2 = service.getIdentifier(userInfoRegular, pairwiseClient2);
View Full Code Here

TOP

Related Classes of org.mitre.openid.connect.model.PairwiseIdentifier

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.