Package com.nimbusds.oauth2.sdk

Examples of com.nimbusds.oauth2.sdk.ErrorObject


   */
  private void ensureQuery()
    throws ParseException {
   
    if (query == null || query.trim().isEmpty())
      throw new ParseException("Missing or empty HTTP query string / entity body");
  }
View Full Code Here


    try {
      contentType = new ContentType(ct);
     
    } catch (javax.mail.internet.ParseException e) {
   
      throw new ParseException("Invalid Content-Type value: " + e.getMessage());
    }
  }
View Full Code Here

   */
  public void ensureContentType()
    throws ParseException {
 
    if (contentType == null)
      throw new ParseException("Missing HTTP Content-Type header");
  }
View Full Code Here

    throws ParseException {
   
    final String clientAssertionType = params.get("client_assertion_type");
   
    if (clientAssertionType == null)
      throw new ParseException("Missing \"client_assertion_type\" parameter");
   
    if (! clientAssertionType.equals(CLIENT_ASSERTION_TYPE))
      throw new ParseException("Invalid \"client_assertion_type\" parameter, must be " + CLIENT_ASSERTION_TYPE);
  }
View Full Code Here

    throws ParseException {
   
    final String clientAssertion = params.get("client_assertion");
   
    if (clientAssertion == null)
      throw new ParseException("Missing \"client_assertion\" parameter");
   
    try {
      return SignedJWT.parse(clientAssertion);
     
    } catch (java.text.ParseException e) {
   
      throw new ParseException("Invalid \"client_assertion\" JWT: " + e.getMessage(), e);
    }
  }
View Full Code Here

    httpRequest.ensureContentType(CommonContentTypes.APPLICATION_URLENCODED);
   
    String query = httpRequest.getQuery();
   
    if (query == null)
      throw new ParseException("Missing HTTP POST request entity body");
   
    Map<String,String> params = URLUtils.parseParameters(query);
   
    JWSAlgorithm alg = parseClientAssertion(params).getHeader().getAlgorithm();
     
    if (ClientSecretJWT.getSupportedJWAs().contains(alg))
      return ClientSecretJWT.parse(params);
       
    else if (PrivateKeyJWT.getSupportedJWAs().contains(alg))
      return PrivateKeyJWT.parse(params);
     
    else
      throw new ParseException("Unsupported signed JWT algorithm: " + alg);
  }
View Full Code Here

    throws ParseException {
   
    String[] parts = header.split("\\s");
   
    if (parts.length != 2)
      throw new ParseException("Unexpected number of HTTP Authorization header value parts: " + parts.length);
   
    if (! parts[0].equalsIgnoreCase("Basic"))
      throw new ParseException("HTTP authentication must be \"Basic\"");
   
    String credentialsString = new String(Base64.decodeBase64(parts[1]), UTF8_CHARSET);

    String[] credentials = credentialsString.split(":", 2);
   
    if (credentials.length != 2)
      throw new ParseException("Missing credentials delimiter \":\"");

    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

    throws ParseException {
   
    String header = httpRequest.getAuthorization();
   
    if (header == null)
      throw new ParseException("Missing HTTP Authorization header");
     
    return parse(header);
  }
View Full Code Here

    try {
      o = new JSONParser(JSONParser.USE_HI_PRECISION_FLOAT).parse(s);
     
    } catch (net.minidev.json.parser.ParseException e) {
     
      throw new ParseException("Invalid JSON: " + e.getMessage(), e);
    }
   
    if (o instanceof JSONObject)
      return (JSONObject)o;
    else
      throw new ParseException("JSON entity is not an object");
  }
View Full Code Here

      if (this.statusCode == c)
        return;
    }

    throw new ParseException("Unexpected HTTP status code " +
      this.statusCode +
      ", must be "
      Arrays.toString(expectedStatusCode));
  }
View Full Code Here

TOP

Related Classes of com.nimbusds.oauth2.sdk.ErrorObject

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.