Class OA2TokenForge
- java.lang.Object
-
- org.oa4mp.delegation.server.OA2TokenForge
-
- All Implemented Interfaces:
TokenForge
public class OA2TokenForge extends Object implements TokenForge
Created by Jeff Gaynor
on 6/4/13 at 4:21 PM
-
-
Field Summary
Fields Modifier and Type Field Description String
accessToken
String
asset
String
authzGrant
String
idToken
String
refreshToken
static int
TYPE_ACCESS_TOKEN
static int
TYPE_AUTH_GRANT
static int
TYPE_ID_TOKEN
static int
TYPE_REFRESH_TOKEN
static int
TYPE_UNKNOWN
String
userInfo
String
verifierToken
-
Constructor Summary
Constructors Constructor Description OA2TokenForge(String server)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
accessToken(String... x)
protected String
asset(String... x)
protected String
authzGrant(String... x)
This and similarly named methods are provided so you can override the specific path components and enforce your own semantics on the tokens.AuthorizationGrantImpl
createToken(AGRequest2 request)
RefreshTokenImpl
createToken(RTIRequest request)
AccessTokenImpl
createToken(ATRequest request)
AccessTokenImpl
getAccessToken(String... tokens)
AccessToken
getAccessToken(Map<String,String> parameters)
AccessToken
getAccessToken(javax.servlet.http.HttpServletRequest request)
edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier>
getAgIdProvider()
edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier>
getAtIdProvider()
AuthorizationGrant
getAuthorizationGrant(String... tokens)
AuthorizationGrant
getAuthorizationGrant(Map<String,String> parameters)
AuthorizationGrant
getAuthorizationGrant(javax.servlet.http.HttpServletRequest request)
TokenImpl
getIDToken(String... tokens)
edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier>
getIDTokenProvider()
RefreshTokenImpl
getRefreshToken(String... tokens)
edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier>
getRefreshTokenProvider()
String
getServer()
protected URI
getServerURI()
String
getStringType(String x)
Takes a token (as a string) and returns a human-readable type of token.int
getType(String x)
protected URI
getURI(String token)
Verifier
getVerifier(String... tokens)
Verifier
getVerifier(Map<String,String> parameters)
Verifier
getVerifier(javax.servlet.http.HttpServletRequest request)
edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier>
getVerifierTokenProvider()
protected String
idToken(String... x)
protected URI
metaCT(IssuerRequest request, edu.uiuc.ncsa.security.core.util.IP2 ip2)
Does some grunt work of figuring out the lifetime then creates the URI.protected String
refreshToken(String... x)
protected String
userInfo(String... x)
protected String
verifierToken(String... x)
-
-
-
Field Detail
-
authzGrant
public String authzGrant
-
accessToken
public String accessToken
-
refreshToken
public String refreshToken
-
verifierToken
public String verifierToken
-
idToken
public String idToken
-
asset
public String asset
-
userInfo
public String userInfo
-
TYPE_AUTH_GRANT
public static final int TYPE_AUTH_GRANT
- See Also:
- Constant Field Values
-
TYPE_ACCESS_TOKEN
public static final int TYPE_ACCESS_TOKEN
- See Also:
- Constant Field Values
-
TYPE_REFRESH_TOKEN
public static final int TYPE_REFRESH_TOKEN
- See Also:
- Constant Field Values
-
TYPE_ID_TOKEN
public static final int TYPE_ID_TOKEN
- See Also:
- Constant Field Values
-
TYPE_UNKNOWN
public static final int TYPE_UNKNOWN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OA2TokenForge
public OA2TokenForge(String server)
-
-
Method Detail
-
createToken
public AuthorizationGrantImpl createToken(AGRequest2 request)
-
createToken
public AccessTokenImpl createToken(ATRequest request)
-
createToken
public RefreshTokenImpl createToken(RTIRequest request)
-
metaCT
protected URI metaCT(IssuerRequest request, edu.uiuc.ncsa.security.core.util.IP2 ip2)
Does some grunt work of figuring out the lifetime then creates the URI. This is the token and is used to create the various implementations.- Parameters:
request
-ip2
-- Returns:
-
authzGrant
protected String authzGrant(String... x)
This and similarly named methods are provided so you can override the specific path components and enforce your own semantics on the tokens. Note that these are called once and are immutable after that. If you need something really exotic you should override the setup() method.- Returns:
-
getServer
public String getServer()
-
getServerURI
protected URI getServerURI()
-
getAccessToken
public AccessToken getAccessToken(Map<String,String> parameters)
- Specified by:
getAccessToken
in interfaceTokenForge
-
getStringType
public String getStringType(String x)
Takes a token (as a string) and returns a human-readable type of token. This is intended to be used in, e.g., logging applications.- Parameters:
x
-- Returns:
-
getType
public int getType(String x)
-
getAuthorizationGrant
public AuthorizationGrant getAuthorizationGrant(Map<String,String> parameters)
- Specified by:
getAuthorizationGrant
in interfaceTokenForge
-
getAuthorizationGrant
public AuthorizationGrant getAuthorizationGrant(javax.servlet.http.HttpServletRequest request)
- Specified by:
getAuthorizationGrant
in interfaceTokenForge
-
getAuthorizationGrant
public AuthorizationGrant getAuthorizationGrant(String... tokens)
- Specified by:
getAuthorizationGrant
in interfaceTokenForge
-
getAccessToken
public AccessToken getAccessToken(javax.servlet.http.HttpServletRequest request)
- Specified by:
getAccessToken
in interfaceTokenForge
-
getAgIdProvider
public edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier> getAgIdProvider()
-
getAtIdProvider
public edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier> getAtIdProvider()
-
getRefreshTokenProvider
public edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier> getRefreshTokenProvider()
-
getIDTokenProvider
public edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier> getIDTokenProvider()
-
getVerifierTokenProvider
public edu.uiuc.ncsa.security.core.util.IP2<edu.uiuc.ncsa.security.core.Identifier> getVerifierTokenProvider()
-
getRefreshToken
public RefreshTokenImpl getRefreshToken(String... tokens)
-
getAccessToken
public AccessTokenImpl getAccessToken(String... tokens)
- Specified by:
getAccessToken
in interfaceTokenForge
-
getVerifier
public Verifier getVerifier(Map<String,String> parameters)
- Specified by:
getVerifier
in interfaceTokenForge
-
getVerifier
public Verifier getVerifier(javax.servlet.http.HttpServletRequest request)
- Specified by:
getVerifier
in interfaceTokenForge
-
getVerifier
public Verifier getVerifier(String... tokens)
- Specified by:
getVerifier
in interfaceTokenForge
-
-