Examples of SerializeException


Examples of com.nimbusds.oauth2.sdk.SerializeException

  @Override
  public void applyTo(final HTTPRequest httpRequest)
    throws SerializeException {
 
    if (httpRequest.getMethod() != HTTPRequest.Method.POST)
      throw new SerializeException("The HTTP request method must be POST");
   
    ContentType ct = httpRequest.getContentType();
   
    if (ct == null)
      throw new SerializeException("Missing HTTP Content-Type header");
   
    if (! ct.match(CommonContentTypes.APPLICATION_URLENCODED))
      throw new SerializeException("The HTTP Content-Type header must be " + CommonContentTypes.APPLICATION_URLENCODED);
   
    Map <String,String> params = httpRequest.getQueryParameters();
   
    params.putAll(toParameters());
   
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

    try {
      params.put("client_assertion", clientAssertion.serialize());
   
    } catch (IllegalStateException e) {
   
      throw new SerializeException("Couldn't serialize JWT to a client assertion string: " + e.getMessage(), e);
   
   
    params.put("client_assertion_type", CLIENT_ASSERTION_TYPE);
   
    return params;
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

  @Override
  public void applyTo(final HTTPRequest httpRequest)
    throws SerializeException {
   
    if (httpRequest.getMethod() != HTTPRequest.Method.POST)
      throw new SerializeException("The HTTP request method must be POST");
   
    ContentType ct = httpRequest.getContentType();
   
    if (ct == null)
      throw new SerializeException("Missing HTTP Content-Type header");
   
    if (! ct.match(CommonContentTypes.APPLICATION_URLENCODED))
      throw new SerializeException("The HTTP Content-Type header must be " + CommonContentTypes.APPLICATION_URLENCODED);
   
    Map <String,String> params = httpRequest.getQueryParameters();
   
    params.putAll(toParameters());
   
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

  @Override
  public HTTPRequest toHTTPRequest()
    throws SerializeException {
   
    if (getEndpointURI() == null)
      throw new SerializeException("The endpoint URI is not specified");

    URL endpointURL;

    try {
      endpointURL = getEndpointURI().toURL();

    } catch (MalformedURLException e) {

      throw new SerializeException(e.getMessage(), e);
    }
 
    HTTPRequest httpRequest = new HTTPRequest(HTTPRequest.Method.DELETE, endpointURL);
    httpRequest.setAuthorization(getAccessToken().toAuthorizationHeader());
    return httpRequest;
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

  @Override
  public HTTPRequest toHTTPRequest()
    throws SerializeException {
   
    if (getEndpointURI() == null)
      throw new SerializeException("The endpoint URI is not specified");

    URL endpointURL;

    try {
      endpointURL = getEndpointURI().toURL();

    } catch (MalformedURLException e) {

      throw new SerializeException(e.getMessage(), e);
    }
 
    HTTPRequest httpRequest = new HTTPRequest(HTTPRequest.Method.POST, endpointURL);

    if (getAccessToken() != null) {
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

  @Override
  public HTTPRequest toHTTPRequest()
    throws SerializeException {
   
    if (getEndpointURI() == null)
      throw new SerializeException("The endpoint URI is not specified");

    URL endpointURL;

    try {
      endpointURL = getEndpointURI().toURL();

    } catch (MalformedURLException e) {

      throw new SerializeException(e.getMessage(), e);
    }
 
    HTTPRequest httpRequest = new HTTPRequest(HTTPRequest.Method.GET, endpointURL);
    httpRequest.setAuthorization(getAccessToken().toAuthorizationHeader());
    return httpRequest;
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

  @Override
  public HTTPRequest toHTTPRequest()
    throws SerializeException{
   
    if (getEndpointURI() == null)
      throw new SerializeException("The endpoint URI is not specified");

    URL endpointURL;

    try {
      endpointURL = getEndpointURI().toURL();

    } catch (MalformedURLException e) {

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

    HTTPRequest httpRequest = new HTTPRequest(HTTPRequest.Method.PUT, endpointURL);

    httpRequest.setAuthorization(getAccessToken().toAuthorizationHeader());
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

      try {
        content = jwt.serialize();
       
      } catch (IllegalStateException e) {
     
        throw new SerializeException("Couldn't serialize UserInfo claims JWT: " +
                               e.getMessage(), e);
      }
    }
   
    httpResponse.setContent(content);
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

  @Override
  public HTTPRequest toHTTPRequest()
    throws SerializeException {
   
    if (getEndpointURI() == null)
      throw new SerializeException("The endpoint URI is not specified");

    URL endpointURL;

    try {
      endpointURL = getEndpointURI().toURL();

    } catch (MalformedURLException e) {

      throw new SerializeException(e.getMessage(), e);
    }
 
    HTTPRequest httpRequest = new HTTPRequest(httpMethod, endpointURL);
   
    switch (httpMethod) {
   
      case GET:
        httpRequest.setAuthorization(getAccessToken().toAuthorizationHeader());
        break;
       
      case POST:
        httpRequest.setContentType(CommonContentTypes.APPLICATION_URLENCODED);
        httpRequest.setQuery("access_token=" + getAccessToken().getValue());
        break;
     
      default:
        throw new SerializeException("Unexpected HTTP method: " + httpMethod);
    }
   
    return httpRequest;
  }
View Full Code Here

Examples of com.nimbusds.oauth2.sdk.SerializeException

      try {
        params.put("id_token", idToken.serialize());   
       
      } catch (IllegalStateException e) {
     
        throw new SerializeException("Couldn't serialize ID token: " + e.getMessage(), e);
     
      }
    }

    return params;
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.