Package io.continual.iam.identity
Class UserContext<I extends Identity>
- java.lang.Object
-
- io.continual.iam.identity.UserContext<I>
-
- All Implemented Interfaces:
JsonSerialized
public class UserContext<I extends Identity> extends Object implements JsonSerialized
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUserContext.Builder<I extends Identity>
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetActualUserId()Get the ID of the actual authenticated user.StringgetEffectiveUserId()Get the ID of the effective user.IdentitygetSponsor()Get the identity of the user that is actually authenticated, which may be different from the "executed as" user.IgetUser()Get the identity for the user that this transaction is being "executed as".org.json.JSONObjecttoJson()StringtoString()
-
-
-
Method Detail
-
getUser
public I getUser()
Get the identity for the user that this transaction is being "executed as".- Returns:
- an identity
-
getSponsor
public Identity getSponsor()
Get the identity of the user that is actually authenticated, which may be different from the "executed as" user.- Returns:
- an identity
-
getEffectiveUserId
public String getEffectiveUserId()
Get the ID of the effective user. Equivalent to getUser().getId()- Returns:
- the effective user ID
-
getActualUserId
public String getActualUserId()
Get the ID of the actual authenticated user. Equivalent to getSponsor().getId()- Returns:
- the actual user ID
-
toJson
public org.json.JSONObject toJson()
- Specified by:
toJsonin interfaceJsonSerialized
-
-