Package com.nimbusds.jwt

Examples of com.nimbusds.jwt.JWT


      "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk";

    response.setContentType(CommonContentTypes.APPLICATION_JWT);
    response.setContent(exampleJWTString);

    JWT jwt = response.getContentAsJWT();
    assertEquals(JWSAlgorithm.HS256, jwt.getHeader().getAlgorithm());
  }
View Full Code Here


     
      response = new UserInfoSuccessResponse(claimsSet);
    }
    else if (ct.match(CommonContentTypes.APPLICATION_JWT)) {
   
      JWT jwt;
     
      try {
        jwt = httpResponse.getContentAsJWT();
       
      } catch (ParseException e) {
View Full Code Here

  public static OIDCAccessTokenResponse parse(final JSONObject jsonObject)
    throws ParseException {
   
    AccessTokenResponse atr = AccessTokenResponse.parse(jsonObject);
   
    JWT idToken = null;
   
    if (jsonObject.containsKey("id_token")) {
     
      try {
        idToken = JWTParser.parse(JSONObjectUtils.getString(jsonObject, "id_token"));
View Full Code Here

    throws ParseException {

    AuthorizationSuccessResponse asr = AuthorizationSuccessResponse.parse(redirectURI, params);

    // Parse id_token parameter
    JWT idToken = null;
   
    if (params.get("id_token") != null) {
     
      try {
        idToken = JWTParser.parse(params.get("id_token"));
View Full Code Here

    }


    v = params.get("id_token_hint");
   
    JWT idTokenHint = null;
   
    if (StringUtils.isNotBlank(v)) {
   
      try {
        idTokenHint = JWTParser.parse(v);
       
      } catch (java.text.ParseException e) {
   
        throw new ParseException("Invalid \"id_token_hint\" parameter: " + e.getMessage(),
                           OAuth2Error.INVALID_REQUEST,
                           clientID, redirectURI, state, e);
      }
    }

    String loginHint = params.get("login_hint");


    v = params.get("acr_values");

    List<ACR> acrValues = null;

    if (StringUtils.isNotBlank(v)) {

      acrValues = new LinkedList<>();

      StringTokenizer st = new StringTokenizer(v, " ");

      while (st.hasMoreTokens()) {

        acrValues.add(new ACR(st.nextToken()));
      }
    }


    v = params.get("claims");

    ClaimsRequest claims = null;

    if (StringUtils.isNotBlank(v)) {

      JSONObject jsonObject;

      try {
        jsonObject = JSONObjectUtils.parseJSONObject(v);

      } catch (ParseException e) {

        throw new ParseException("Invalid \"claims\" parameter: " + e.getMessage(),
                           OAuth2Error.INVALID_REQUEST,
                           clientID, redirectURI, state, e);
      }

      // Parse exceptions silently ignored
      claims = ClaimsRequest.parse(jsonObject);
    }
   
   
    v = params.get("request_uri");
   
    URI requestURI = null;
   
    if (StringUtils.isNotBlank(v)) {

      try {
        requestURI = new URI(v);
   
      } catch (URISyntaxException e) {
     
        throw new ParseException("Invalid \"request_uri\" parameter: " + e.getMessage(),
                           OAuth2Error.INVALID_REQUEST,
                           clientID, redirectURI, state, e);
      }
    }

    v = params.get("request");

    JWT requestObject = null;

    if (StringUtils.isNotBlank(v)) {

      // request_object and request_uri must not be defined at the same time
      if (requestURI != null) {
View Full Code Here

      // Return the same request
      return request;
    }

    try {
      JWT jwt;

      if (request.getRequestURI() != null) {

        // Download request object
        URL requestURL;
View Full Code Here

TOP

Related Classes of com.nimbusds.jwt.JWT

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.