Package com.nimbusds.oauth2.sdk.id

Examples of com.nimbusds.oauth2.sdk.id.Subject


  }


  public void testPullAllSubjectMismatch() {

    Subject alice = new Subject("alice");
    Subject bob = new Subject("bob");

    UserInfo userInfoAlice = new UserInfo(alice);
    userInfoAlice.setGivenName("Alice");

    UserInfo userInfoBob = new UserInfo(bob);
View Full Code Here



  public void testPlain()
    throws Exception {

    UserInfo claims = new UserInfo(new Subject("alice"));
    claims.setName("Alice Adams");
    claims.setEmail(new InternetAddress("alice@wonderland.net"));
    claims.setEmailVerified(true);

    UserInfoSuccessResponse response = new UserInfoSuccessResponse(claims);
View Full Code Here


  public void testJWT()
    throws Exception {

    UserInfo claims = new UserInfo(new Subject("alice"));
    claims.setName("Alice Adams");
    claims.setEmail(new InternetAddress("alice@wonderland.net"));
    claims.setEmailVerified(true);

    JWTClaimsSet claimsSet = claims.toJWTClaimsSet();
View Full Code Here

  public void testGettersAndSetters()
    throws Exception {

    Issuer issuer = new Issuer("iss");
    Subject subject = new Subject("sub");

    List<Audience> audList = new LinkedList<>();
    audList.add(new Audience("aud"));

    Date expirationTime = DateUtils.fromSecondsSinceEpoch(100000l);
View Full Code Here

  public void testSingleAudSetAndGetWorkaround()
    throws Exception {

    Issuer issuer = new Issuer("iss");
    Subject subject = new Subject("sub");

    List<Audience> audList = new LinkedList<>();
    audList.add(new Audience("aud"));

    Date expirationTime = DateUtils.fromSecondsSinceEpoch(100000l);
View Full Code Here

    responseType.add(ResponseType.Value.TOKEN);
    responseType.add(OIDCResponseTypeValue.ID_TOKEN);

    IDTokenClaimsSet claimsSet = new IDTokenClaimsSet(
      new Issuer("iss"),
      new Subject("sub"),
      new Audience("aud").toSingleAudienceList(),
      new Date(),
      new Date());

    assertFalse(claimsSet.hasRequiredClaims(responseType));
View Full Code Here

    ResponseType responseType = new ResponseType();
    responseType.add(ResponseType.Value.CODE);

    IDTokenClaimsSet claimsSet = new IDTokenClaimsSet(
      new Issuer("iss"),
      new Subject("sub"),
      new Audience("aud").toSingleAudienceList(),
      new Date(),
      new Date());

    assertFalse(claimsSet.hasRequiredClaims(responseType));
View Full Code Here

    responseType.add(ResponseType.Value.TOKEN);
    responseType.add(OIDCResponseTypeValue.ID_TOKEN);

    IDTokenClaimsSet claimsSet = new IDTokenClaimsSet(
      new Issuer("iss"),
      new Subject("sub"),
      new Audience("aud").toSingleAudienceList(),
      new Date(),
      new Date());

    assertFalse(claimsSet.hasRequiredClaims(responseType));
View Full Code Here

  public void testSubjectJWK()
    throws Exception {

    IDTokenClaimsSet claimsSet = new IDTokenClaimsSet(
      new Issuer("iss"),
      new Subject("sub"),
      new Audience("aud").toSingleAudienceList(),
      new Date(),
      new Date());

    assertNull(claimsSet.getSubjectJWK());
View Full Code Here

  public void testRejectPrivateSubjectJWK()
    throws Exception {

    IDTokenClaimsSet claimsSet = new IDTokenClaimsSet(
      new Issuer("iss"),
      new Subject("sub"),
      new Audience("aud").toSingleAudienceList(),
      new Date(),
      new Date());

    assertNull(claimsSet.getSubjectJWK());
View Full Code Here

TOP

Related Classes of com.nimbusds.oauth2.sdk.id.Subject

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.