Package com.nimbusds.oauth2.sdk

Examples of com.nimbusds.oauth2.sdk.SerializeException


 
 
  public void testResolveToUserInfo()
    throws Exception {
   
    Scope scope = Scope.parse("openid email profile phone address");
   
    ClaimsRequest cr = ClaimsRequest.resolve(ResponseType.parse("code"), scope);
   
    System.out.println("Claims request for scope openid email profile phone address: " + cr.toJSONObject());
   
View Full Code Here



  public void testResolveToIDToken()
    throws Exception {

    Scope scope = Scope.parse("openid email profile phone address");

    ClaimsRequest cr = ClaimsRequest.resolve(ResponseType.parse("id_token"), scope);

    System.out.println("Claims request for scope openid email profile phone address: " + cr.toJSONObject());
View Full Code Here

  @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

    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

  @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

  @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

  @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

  @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

  @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

      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

TOP

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

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.