public class BasicClaimsSourceImpl extends Object implements ClaimSource
Created by Jeff Gaynor
on 8/17/15 at 4:10 PM
Modifier and Type | Field and Description |
---|---|
protected GroupHandler |
groupHandler |
Constructor and Description |
---|
BasicClaimsSourceImpl() |
BasicClaimsSourceImpl(OA2SE oa2SE) |
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getClaims()
returns a (unique) collection of claims.
|
ClaimSourceConfiguration |
getConfiguration() |
GroupHandler |
getGroupHandler() |
OA2SE |
getOa2SE()
Optionally, the service environment may be injected into a scope handler to get configuration of
components, e.g.
|
List<String> |
getOmitList()
This is the list of claims from the headers to omit.
|
Script |
getPostProcessor()
See comment in
ClaimSource.getPreProcessor() . |
Script |
getPreProcessor()
This is the preprocessor after it has run.
|
Collection<String> |
getScopes()
A list of scopes that this source supports.
|
boolean |
hasConfiguration() |
boolean |
hasJSONPostProcessoor() |
boolean |
hasJSONPreProcessoor() |
boolean |
isEnabled() |
boolean |
isRunAtAuthorization()
Whether to run this during the authorization phase or not.
|
net.sf.json.JSONObject |
process(net.sf.json.JSONObject claims,
javax.servlet.http.HttpServletRequest request,
ServiceTransaction transaction)
This also just returns the
UserInfo object passed in. |
net.sf.json.JSONObject |
process(net.sf.json.JSONObject claims,
ServiceTransaction transaction)
At the most basic level, this just returns the
UserInfo object passed to it. |
protected net.sf.json.JSONObject |
realProcessing(net.sf.json.JSONObject claims,
javax.servlet.http.HttpServletRequest request,
ServiceTransaction transaction)
This is the actual place to put your code that only processes the claim source.
|
void |
setConfiguration(ClaimSourceConfiguration configuration)
This passes in a
JSONObject that is in turn used to configure the source. |
void |
setGroupHandler(GroupHandler groupHandler) |
void |
setOa2SE(OA2SE oa2SE) |
void |
setOmitList(List<String> omitList) |
void |
setScopes(Collection<String> scopes)
Set the scopes for this source.
|
protected GroupHandler groupHandler
public BasicClaimsSourceImpl(OA2SE oa2SE)
public BasicClaimsSourceImpl()
public List<String> getOmitList()
public void setConfiguration(ClaimSourceConfiguration configuration)
ClaimSource
JSONObject
that is in turn used to configure the source. It is up to the implementaton
to make sense of this.setConfiguration
in interface ClaimSource
public ClaimSourceConfiguration getConfiguration()
getConfiguration
in interface ClaimSource
public boolean hasConfiguration()
hasConfiguration
in interface ClaimSource
public boolean hasJSONPreProcessoor()
public boolean hasJSONPostProcessoor()
public boolean isEnabled()
isEnabled
in interface ClaimSource
public OA2SE getOa2SE()
public void setOa2SE(OA2SE oa2SE)
public Collection<String> getScopes()
ClaimSource
getScopes
in interface ClaimSource
public net.sf.json.JSONObject process(net.sf.json.JSONObject claims, ServiceTransaction transaction) throws UnsupportedScopeException
UserInfo
object passed to it. Override as you deem fit.process
in interface ClaimSource
claims
- transaction
- UnsupportedScopeException
public net.sf.json.JSONObject process(net.sf.json.JSONObject claims, javax.servlet.http.HttpServletRequest request, ServiceTransaction transaction) throws UnsupportedScopeException
UserInfo
object passed in.process
in interface ClaimSource
claims
- request
- transaction
- UnsupportedScopeException
public GroupHandler getGroupHandler()
public void setGroupHandler(GroupHandler groupHandler)
protected net.sf.json.JSONObject realProcessing(net.sf.json.JSONObject claims, javax.servlet.http.HttpServletRequest request, ServiceTransaction transaction) throws UnsupportedScopeException
process(JSONObject, HttpServletRequest, ServiceTransaction)
calls wrap this and invoke the pre/post processor for you. Your code should take whatever metadata is for the user
and add it to the claims object.claims
- request
- transaction
- UnsupportedScopeException
public void setScopes(Collection<String> scopes)
ClaimSource
setScopes
in interface ClaimSource
public Collection<String> getClaims()
getClaims
in interface ClaimSource
public boolean isRunAtAuthorization()
ClaimSource
isRunAtAuthorization
in interface ClaimSource
public Script getPostProcessor()
ClaimSource
ClaimSource.getPreProcessor()
.getPostProcessor
in interface ClaimSource
public Script getPreProcessor()
ClaimSource
getPreProcessor
in interface ClaimSource
Copyright © 2019. All Rights Reserved.