Package com.nimbusds.jwt

Examples of com.nimbusds.jwt.SignedJWT.serialize()


    signingAndValidationService.signJwt(jwt);

    try {
      URIBuilder uriBuilder = new URIBuilder(serverConfig.getAuthorizationEndpointUri());
      uriBuilder.addParameter("request", jwt.serialize());

      // build out the URI
      return uriBuilder.build().toString();
    } catch (URISyntaxException e) {
      throw new AuthenticationServiceException("Malformed Authorization Endpoint Uri", e);
View Full Code Here


          // sign it with the server's key
          jwtService.signJwt(signed);
        }

        Writer out = response.getWriter();
        out.write(signed.serialize());
      }
    } catch (IOException e) {
      logger.error("IO Exception in UserInfoJwtView", e);
    } catch (ParseException e) {
      // TODO Auto-generated catch block
View Full Code Here

        SignedJWT jwt = new SignedJWT(new JWSHeader(alg), claimsSet);

        signer.signJwt(jwt, alg);

        form.add("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer");
        form.add("client_assertion", jwt.serialize());
      } else {
        //Alternatively use form based auth
        form.add("client_id", clientConfig.getClientId());
        form.add("client_secret", clientConfig.getClientSecret());
      }
View Full Code Here

    request = OIDCClientRegistrationRequest.parse(httpRequest);

    assertEquals("https://client.com/in", request.getClientMetadata().getRedirectionURIs().iterator().next().toString());
    assertEquals("Test App", request.getClientMetadata().getName());
    assertEquals(jwt.serialize(), request.getSoftwareStatement().getParsedString());
    assertTrue(request.getSoftwareStatement().verify(new MACVerifier("abcdef1234567890")));
  }


  public void testRejectUnsignedSoftwareStatement()
View Full Code Here

    request = ClientRegistrationRequest.parse(httpRequest);

    assertEquals("https://client.com/in", request.getClientMetadata().getRedirectionURIs().iterator().next().toString());
    assertEquals("Test App", request.getClientMetadata().getName());
    assertEquals(jwt.serialize(), request.getSoftwareStatement().getParsedString());
    assertTrue(request.getSoftwareStatement().verify(new MACVerifier("abcdef1234567890")));
  }


  public void testRejectUnsignedSoftwareStatement()
View Full Code Here

   
    JWSSigner signer = new MACSigner(TOKEN_SECRET);
    SignedJWT jwt = new SignedJWT(JWT_HEADER, claim);
    jwt.sign(signer);
   
    return new Token(jwt.serialize());
  }
 
  public static String getSerializedToken(String authHeader) {
    return authHeader.split(" ")[1];
  }
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.