Package org.jclouds.oauth.v2.features

Examples of org.jclouds.oauth.v2.features.OAuthApiLiveTest


      String scopes = getMandatoryProperty(properties, SCOPES);
      String audience = getMandatoryProperty(properties, AUDIENCE);

      long now = nowInSeconds();

      ClaimSet claimSet = ClaimSet.builder().addClaim("aud", audience).addClaim("scope", scopes).addClaim("iss",
              identity).emissionTime(now).expirationTime(now + 3600).build();

      TokenRequest tokenRequest = TokenRequest.builder().header(header).claimSet(claimSet).build();
      Token token = api.authenticate(tokenRequest);
View Full Code Here


      Header header = Header.builder().signerAlgorithm(signatureAlgorithm).type("JWT").build();

      long now = SECONDS.convert(System.currentTimeMillis(), MILLISECONDS);

      ClaimSet claimSet = ClaimSet.builder()
                                  .addClaim("aud", audience)
                                  .addClaim("scope", scopes)
                                  .addClaim("iss", identity)
                                  .emissionTime(now)
                                  .expirationTime(now + 3600).build();
View Full Code Here

      Header header = Header.builder().signerAlgorithm(signatureAlgorithm).type("JWT").build();

      long now = SECONDS.convert(Ticker.systemTicker().read(), NANOSECONDS);

      ClaimSet claimSet = ClaimSet.builder()
                                  .addClaim("aud", audience)
                                  .addClaim("scope", scopes)
                                  .addClaim("iss", identity)
                                  .emissionTime(now)
                                  .expirationTime(now + 3600).build();
View Full Code Here

      String scopes = getMandatoryProperty(properties, SCOPES);
      String audience = getMandatoryProperty(properties, AUDIENCE);

      long now = nowInSeconds();

      ClaimSet claimSet = ClaimSet.builder().addClaim("aud", audience).addClaim("scope", scopes).addClaim("iss",
              identity).emissionTime(now).expirationTime(now + 3600).build();

      TokenRequest tokenRequest = TokenRequest.builder().header(header).claimSet(claimSet).build();
      Token token = api.authenticate(tokenRequest);
View Full Code Here

      Header header = new Header.Builder()
              .signerAlgorithm(signatureAlgorithm)
              .type(tokenRequestFormat.getTypeName())
              .build();

      ClaimSet claimSet = new ClaimSet.Builder(this.tokenRequestFormat.requiredClaims())
              .addClaim("iss", credentialsSupplier.get().identity)
              .addClaim("scope", getOAuthScopes(request))
              .addClaim("aud", assertionTargetDescription)
              .emissionTime(now)
              .expirationTime(now + tokenDuration)
View Full Code Here

      TokenRequestFormat tokenRequestFormat = ContextBuilder.newBuilder(new OAuthApiMetadata()).overrides
              (OAuthTestUtils.defaultProperties(null)).build().utils()
              .injector().getInstance(TokenRequestFormat.class);
      Header header = new Header.Builder().signerAlgorithm("a").type("b").build();
      ClaimSet claimSet = new ClaimSet.Builder().addClaim("ist", STRING_THAT_GENERATES_URL_UNSAFE_BASE64_ENCODING)
              .build();
      TokenRequest tokenRequest = new TokenRequest.Builder().claimSet(claimSet).header(header).build();
      HttpRequest request = tokenRequestFormat.formatRequest(HttpRequest.builder().method("GET").endpoint
              ("http://localhost").build(), tokenRequest);
View Full Code Here

      Header header = Header.builder().signerAlgorithm(signatureAlgorithm).type("JWT").build();

      long now = SECONDS.convert(System.currentTimeMillis(), MILLISECONDS);

      ClaimSet claimSet = ClaimSet.builder()
                                  .addClaim("aud", audience)
                                  .addClaim("scope", scopes)
                                  .addClaim("iss", identity)
                                  .emissionTime(now)
                                  .expirationTime(now + 3600).build();
View Full Code Here

   @Override
   public TokenRequest apply(GeneratedHttpRequest request) {
      long now = TimeUnit.SECONDS.convert(ticker.read(), TimeUnit.NANOSECONDS);

      // fetch the token
      Header header = new Header.Builder()
              .signerAlgorithm(signatureAlgorithm)
              .type(tokenRequestFormat.getTypeName())
              .build();

      ClaimSet claimSet = new ClaimSet.Builder(this.tokenRequestFormat.requiredClaims())
View Full Code Here

   @Override
   public TokenRequest apply(GeneratedHttpRequest request) {
      long now = timeSourceMillisSinceEpoch.get() / 1000;

      // fetch the token
      Header header = new Header.Builder()
              .signerAlgorithm(signatureAlgorithm)
              .type(tokenRequestFormat.getTypeName())
              .build();

      ClaimSet claimSet = new ClaimSet.Builder(this.tokenRequestFormat.requiredClaims())
View Full Code Here

   public void testPayloadIsUrlSafe() throws IOException {

      TokenRequestFormat tokenRequestFormat = ContextBuilder.newBuilder(new OAuthApiMetadata()).overrides
              (OAuthTestUtils.defaultProperties(null)).build().utils()
              .injector().getInstance(TokenRequestFormat.class);
      Header header = new Header.Builder().signerAlgorithm("a").type("b").build();
      ClaimSet claimSet = new ClaimSet.Builder().addClaim("ist", STRING_THAT_GENERATES_URL_UNSAFE_BASE64_ENCODING)
              .build();
      TokenRequest tokenRequest = new TokenRequest.Builder().claimSet(claimSet).header(header).build();
      HttpRequest request = tokenRequestFormat.formatRequest(HttpRequest.builder().method("GET").endpoint
              ("http://localhost").build(), tokenRequest);
View Full Code Here

TOP

Related Classes of org.jclouds.oauth.v2.features.OAuthApiLiveTest

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.