org.jclouds.oauth.v2.json
Class JWTTokenRequestFormat

java.lang.Object
  extended by org.jclouds.oauth.v2.json.JWTTokenRequestFormat
All Implemented Interfaces:
TokenRequestFormat

@Singleton
public class JWTTokenRequestFormat
extends Object
implements TokenRequestFormat

Formats a token request into JWT format namely: - transforms the token request to json - creates the base64 header.claimset portions of the payload. - uses the provided signer function to create a signature - creates the full url encoded payload as described in: https://developers.google.com/accounts/docs/OAuth2ServiceAccount

Author:
David Alves

Constructor Summary
JWTTokenRequestFormat(com.google.common.base.Function<byte[],byte[]> signer, org.jclouds.json.Json json)
           
 
Method Summary
<R extends org.jclouds.http.HttpRequest>
R
formatRequest(R request, TokenRequest tokenRequest)
          Transforms the provided HttpRequest into a particular token request with a specific format.
 String getTypeName()
          The name of the type of the token request, e.g., "JWT"
 Set<String> requiredClaims()
          The claims that must be present in the token request for it to be valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWTTokenRequestFormat

@Inject
public JWTTokenRequestFormat(com.google.common.base.Function<byte[],byte[]> signer,
                                    org.jclouds.json.Json json)
Method Detail

formatRequest

public <R extends org.jclouds.http.HttpRequest> R formatRequest(R request,
                                                                TokenRequest tokenRequest)
Description copied from interface: TokenRequestFormat
Transforms the provided HttpRequest into a particular token request with a specific format.

Specified by:
formatRequest in interface TokenRequestFormat

getTypeName

public String getTypeName()
Description copied from interface: TokenRequestFormat
The name of the type of the token request, e.g., "JWT"

Specified by:
getTypeName in interface TokenRequestFormat

requiredClaims

public Set<String> requiredClaims()
Description copied from interface: TokenRequestFormat
The claims that must be present in the token request for it to be valid.

Specified by:
requiredClaims in interface TokenRequestFormat


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.