Interface ClaimSource
-
- All Superinterfaces:
Serializable
public interface ClaimSource extends Serializable
This is charged with modelling the source for sets of claims. Note that the contract of the standard implementation is to have a no argument constructor that has a JSON object injected as the configuration.Created by Jeff Gaynor
on 8/17/15 at 2:28 PM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfromQDL(org.qdl_lang.variables.QDLStem stem)Deserialize this claim source from its QDL representation.Collection<String>getClaims()in order to support server discovery, every plugin must enumerate whatever claims it may serve.ClaimSourceConfigurationgetConfiguration()Collection<String>getScopes()A list of scopes that this source supports.booleanhasConfiguration()booleanisEnabled()booleanisRunOnlyAtAuthorization()Whether to run this during the authorization phase or not.net.sf.json.JSONObjectprocess(net.sf.json.JSONObject claims, javax.servlet.http.HttpServletRequest request, ServiceTransaction transaction)net.sf.json.JSONObjectprocess(net.sf.json.JSONObject claims, ServiceTransaction transaction)AUserInfoobject and the current service transaction are supplied.voidsetConfiguration(ClaimSourceConfiguration configuration)This passes in aJSONObjectthat is in turn used to configure the source.voidsetScopes(Collection<String> scopes)Set the scopes for this source.org.qdl_lang.variables.QDLStemtoQDL()Serialize this claim source to its QDL representation.
-
-
-
Method Detail
-
setConfiguration
void setConfiguration(ClaimSourceConfiguration configuration)
This passes in aJSONObjectthat is in turn used to configure the source. It is up to the implementaton to make sense of this.- Parameters:
configuration-
-
getConfiguration
ClaimSourceConfiguration getConfiguration()
-
hasConfiguration
boolean hasConfiguration()
-
process
net.sf.json.JSONObject process(net.sf.json.JSONObject claims, ServiceTransaction transaction) throws UnsupportedScopeExceptionAUserInfoobject and the current service transaction are supplied. The contract is that this handler will receive a claims object with standard information in place for the request, but may then populate a claims object and return it. It is up to the source to run the pre and post processors before actually invoking the claims.- Parameters:
claims-transaction-- Returns:
- Throws:
UnsupportedScopeException
-
process
net.sf.json.JSONObject process(net.sf.json.JSONObject claims, javax.servlet.http.HttpServletRequest request, ServiceTransaction transaction) throws UnsupportedScopeException- Throws:
UnsupportedScopeException
-
setScopes
void setScopes(Collection<String> scopes)
Set the scopes for this source.- Parameters:
scopes-
-
getScopes
Collection<String> getScopes()
A list of scopes that this source supports. Any scope that is not recognized by this source should be rejected.- Returns:
-
getClaims
Collection<String> getClaims()
in order to support server discovery, every plugin must enumerate whatever claims it may serve. This is not a guarantee that all of these claims will be delivered, just that they might be.- Returns:
-
isEnabled
boolean isEnabled()
-
isRunOnlyAtAuthorization
boolean isRunOnlyAtAuthorization()
Whether to run this during the authorization phase or not. That means it will either run in the authorization servlet or, if there is an external authorization application (e.g. Shibboleth) it will be invoked when the transaction has been created. Normally this is set true if there is some state (such as reading claims from HTTP headers) that will not exist after the authorization has happened. The other option (when this is false) is to be invoked immediately before the access token is issued. Note that if there are out of band operations (e.g. CILogon makes several calls to the backend database as it gets the user information together) then all of those should be done by the time the access token is issued.- Returns:
-
fromQDL
void fromQDL(org.qdl_lang.variables.QDLStem stem)
Deserialize this claim source from its QDL representation.- Parameters:
stem-
-
toQDL
org.qdl_lang.variables.QDLStem toQDL()
Serialize this claim source to its QDL representation.- Returns:
-
-