Package com.nimbusds.oauth2.sdk.auth

Examples of com.nimbusds.oauth2.sdk.auth.Secret


      throw new ParseException(e.getMessage(), e);
    }

    // Check that the top level client_id matches the assertion subject + issuer

    ClientID clientID = JWTAuthentication.parseClientID(params);

    if (clientID != null) {

      if (! clientID.equals(privateKeyJWT.getClientID()))
        throw new ParseException("The client identifier doesn't match the client assertion subject / issuer");
    }

    return privateKeyJWT;
  }
View Full Code Here


    if (clientAuth == null && grant.getType().requiresClientAuthentication()) {
      throw new ParseException("Missing client authentication", OAuth2Error.INVALID_CLIENT);
    }

    // Parse client id
    ClientID clientID = null;

    if (clientAuth == null) {

      // Parse optional client ID
      String clientIDString = params.get("client_id");

      if (clientIDString != null && clientIDString.trim().length() > 0)
        clientID = new ClientID(clientIDString);

      if (clientID == null && grant.getType().requiresClientID()) {
        throw new ParseException("Missing required \"client_id\" parameter", OAuth2Error.INVALID_REQUEST);
      }
    }
View Full Code Here

      throw new ParseException(e.getMessage(), e);
    }

    // Check that the top level client_id matches the assertion subject + issuer
   
    ClientID clientID = JWTAuthentication.parseClientID(params);

    if (clientID != null) {

      if (! clientID.equals(clientSecretJWT.getClientID()))
        throw new ParseException("The client identifier doesn't match the client assertion subject / issuer");
    }

    return clientSecretJWT;
  }
View Full Code Here

      throw new IllegalArgumentException("Missing issuer in client JWT assertion");

    if (!subjectValue.equals(issuerValue))
      throw new IllegalArgumentException("Issuer and subject in client JWT assertion must designate the same client identifier");

    return new ClientID(subjectValue);
  }
View Full Code Here

    if (StringUtils.isBlank(v))
      throw new ParseException("Missing \"client_id\" parameter",
        OAuth2Error.INVALID_REQUEST);

    ClientID clientID = new ClientID(v);


    // Parse optional redirection URI second
    v = params.get("redirect_uri");
View Full Code Here

    if (clientIDString == null)
      return null;

    else
      return new ClientID(clientIDString);
  }
View Full Code Here

    try {
      String decodedClientID = URLDecoder.decode(credentials[0], UTF8_CHARSET.name());
      String decodedSecret = URLDecoder.decode(credentials[1], UTF8_CHARSET.name());

      return new ClientSecretBasic(new ClientID(decodedClientID), new Secret(decodedSecret));
     
    } catch (UnsupportedEncodingException e) {
   
      throw new ParseException(e.getMessage(), e);
    }
View Full Code Here

  public void testWithAccessTokenAndClientAuth()
    throws Exception {

    URI endpointURI = new URI("https://c2id.com/token/revoke");
    Token token = new BearerAccessToken();
    ClientAuthentication clientAuth = new ClientSecretBasic(new ClientID("123"), new Secret("secret"));

    TokenRevocationRequest request = new TokenRevocationRequest(endpointURI, clientAuth, token);
    assertEquals(endpointURI, request.getEndpointURI());
    assertEquals(clientAuth, request.getClientAuthentication());
    assertEquals(token, request.getToken());
View Full Code Here

  public void testWithRefreshTokenAndClientAuth()
    throws Exception {

    URI endpointURI = new URI("https://c2id.com/token/revoke");
    Token token = new RefreshToken();
    ClientAuthentication clientAuth = new ClientSecretBasic(new ClientID("123"), new Secret("secret"));

    TokenRevocationRequest request = new TokenRevocationRequest(endpointURI, clientAuth, token);
    assertEquals(endpointURI, request.getEndpointURI());
    assertEquals(clientAuth, request.getClientAuthentication());
    assertEquals(token, request.getToken());
View Full Code Here

            final JWTID jti) {

    if (clientID == null)
      throw new IllegalArgumentException("The client ID must not be null");

    iss = new Issuer(clientID.getValue());

    sub = new Subject(clientID.getValue());

   
    if (aud == null)
View Full Code Here

TOP

Related Classes of com.nimbusds.oauth2.sdk.auth.Secret

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.