public class AuthSvcClient
extends java.lang.Object
executeInInfoMap(Context, String)
executeInInfoMap(Context, String, STSUniversalUser)
executeInAccessPolicy(Context, String)
executeInAccessPolicy(Context, String, STSUniversalUser)
execute(String)
execute(String, STSUniversalUser)
getRequestTokenAttrAsStsuu(Context)
and
getSimpleSTSUU(String)
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
execute(java.lang.String payload)
Execute an authentication policy from within a mapping rule.
|
static java.lang.String |
execute(java.lang.String payload,
STSUniversalUser stsuu)
Execute an authentication policy from within a mapping rule.
|
static java.lang.String |
executeInAccessPolicy(Context accessPolicyContext,
java.lang.String payload)
Execute an authentication policy from within a running Access Policy.
|
static java.lang.String |
executeInAccessPolicy(Context accessPolicyContext,
java.lang.String payload,
STSUniversalUser stsuu)
Execute an authentication policy from within a running Access Policy.
|
static java.lang.String |
executeInInfoMap(Context context,
java.lang.String payload)
Execute an authentication policy from within a running InfoMap.
|
static java.lang.String |
executeInInfoMap(Context context,
java.lang.String payload,
STSUniversalUser stsuu)
Execute an authentication policy from within a running InfoMap.
|
static STSUniversalUser |
getRequestTokenAttrAsStsuu(Context context)
Creates a new STSUniversalUser object with the attributes in any identity tokens available in the given InfoMap
context.
|
static STSUniversalUser |
getSimpleSTSUU(java.lang.String username)
Creates a new STSUniversalUser object with the principal name set to the given username.
|
static void |
JSONToSession(java.lang.String jsonString,
CleanableSession session) |
static void |
prepareContextFromJson(JSONObject json,
AuthSvcClientContextView contextView) |
static JSONObject |
sessionToJSON(CleanableSession session) |
public static java.lang.String execute(java.lang.String payload)
execute(String, STSUniversalUser)
to include user information.
Example input payload with PolicyId: { "PolicyId": "urn:ibm:security:authentication:asf:totp" "operation": "verify", "otp": "123456" } Example input payload with StateId: { "StateId": "BQ4TUc6sIeuprD3ToVBCumClgcAwtGLlPPbdM0A49BBcCcriF2Pz85H5bQmz8KKPHXp2XAfdQMPB7MYTAJsEqu3Fu2xcN5j..." "operation": "verify", "otp": "123456" } Example response payload: { "status":"pause", "page":"\/authsvc\/authenticator\/totp\/login.html", "response": { "mechanism":"urn:ibm:security:authentication:asf:mechanism:totp", "state":"dvsPJX3HPLufKsflRcOEZqwYODt1wpRjjq9n4ewjxeeTlRJCs7d5x7HRa02OD8t9RAzAtqwXU4ILO09RqpeSb6TlulqKxdu...", "message":"", "exceptionMsg":"" } }
payload
- The policy payload as stringified JSON. Must include either the policy ID (PolicyId), or a state ID
(StateId), and other request parameters dependent on the policy being run. For example, the
"operation" parameter is required to complete most policies.public static java.lang.String executeInInfoMap(Context context, java.lang.String payload)
executeInInfoMap(Context, String, STSUniversalUser)
to include user information.
Example input payload with PolicyId: { "PolicyId": "urn:ibm:security:authentication:asf:totp" "operation": "verify", "otp": "123456" } Example input payload with StateId: { "StateId": "BQ4TUc6sIeuprD3ToVBCumClgcAwtGLlPPbdM0A49BBcCcriF2Pz85H5bQmz8KKPHXp2XAfdQMPB7MYTAJsEqu3Fu2xcN5j..." "operation": "verify", "otp": "123456" } Example response payload: { "status":"pause", "page":"\/authsvc\/authenticator\/totp\/login.html", "response": { "mechanism":"urn:ibm:security:authentication:asf:mechanism:totp", "state":"dvsPJX3HPLufKsflRcOEZqwYODt1wpRjjq9n4ewjxeeTlRJCs7d5x7HRa02OD8t9RAzAtqwXU4ILO09RqpeSb6TlulqKxdu...", "message":"", "exceptionMsg":"" } }
context
- The context variable provided to the Info Map. Required to save the inner policy execution context,
and fetch locale for translated messages.payload
- The policy payload as stringified JSON. Must include either the policy ID (PolicyId), or a state ID
(StateId), and other request parameters dependent on the policy being run. For example, the
"operation" parameter is required to complete most policies.public static java.lang.String executeInAccessPolicy(Context accessPolicyContext, java.lang.String payload)
executeInAccessPolicy(com.ibm.security.access.policy.Context, String, STSUniversalUser)
to include user
information.
Example input payload with PolicyId: { "PolicyId": "urn:ibm:security:authentication:asf:totp" "operation": "verify", "otp": "123456" } Example input payload with StateId: { "StateId": "BQ4TUc6sIeuprD3ToVBCumClgcAwtGLlPPbdM0A49BBcCcriF2Pz85H5bQmz8KKPHXp2XAfdQMPB7MYTAJsEqu3Fu2xcN5j..." "operation": "verify", "otp": "123456" } Example response payload: { "status":"pause", "page":"\/authsvc\/authenticator\/totp\/login.html", "response": { "mechanism":"urn:ibm:security:authentication:asf:mechanism:totp", "state":"dvsPJX3HPLufKsflRcOEZqwYODt1wpRjjq9n4ewjxeeTlRJCs7d5x7HRa02OD8t9RAzAtqwXU4ILO09RqpeSb6TlulqKxdu...", "message":"", "exceptionMsg":"" } }
accessPolicyContext
- The context variable provided to the Access Policy. Required to save the inner policy
execution context, and fetch locale for translated messages.payload
- The policy payload as stringified JSON. Must include either the policy ID (PolicyId), or a
state ID (StateId), and other request parameters dependent on the policy being run. For
example, the "operation" parameter is required to complete most policies.public static java.lang.String execute(java.lang.String payload, STSUniversalUser stsuu)
Example input payload with PolicyId: { "PolicyId": "urn:ibm:security:authentication:asf:totp" "operation": "verify", "otp": "123456" } Example input payload with StateId: { "StateId": "BQ4TUc6sIeuprD3ToVBCumClgcAwtGLlPPbdM0A49BBcCcriF2Pz85H5bQmz8KKPHXp2XAfdQMPB7MYTAJsEqu3Fu2xcN5j..." "operation": "verify", "otp": "123456" } Example response payload: { "status":"pause", "page":"\/authsvc\/authenticator\/totp\/login.html", "response": { "mechanism":"urn:ibm:security:authentication:asf:mechanism:totp", "state":"dvsPJX3HPLufKsflRcOEZqwYODt1wpRjjq9n4ewjxeeTlRJCs7d5x7HRa02OD8t9RAzAtqwXU4ILO09RqpeSb6TlulqKxdu...", "message":"", "exceptionMsg":"" } }
payload
- The policy payload as stringified JSON. Must include either the policy ID (PolicyId), or a state ID
(StateId), and other request parameters dependent on the policy being run. For example, the
"operation" parameter is required to complete most policies.stsuu
- The user identity to complete the policy with. Can be constructed as per usual for mapping rules, or
using one of the AuthSvcClient helper functions. See getRequestTokenAttrAsStsuu(Context)
and
getSimpleSTSUU(String)
public static java.lang.String executeInInfoMap(Context context, java.lang.String payload, STSUniversalUser stsuu)
Example input payload with PolicyId: { "PolicyId": "urn:ibm:security:authentication:asf:totp" "operation": "verify", "otp": "123456" } Example input payload with StateId: { "StateId": "BQ4TUc6sIeuprD3ToVBCumClgcAwtGLlPPbdM0A49BBcCcriF2Pz85H5bQmz8KKPHXp2XAfdQMPB7MYTAJsEqu3Fu2xcN5j..." "operation": "verify", "otp": "123456" } Example response payload: { "status":"pause", "page":"\/authsvc\/authenticator\/totp\/login.html", "response": { "mechanism":"urn:ibm:security:authentication:asf:mechanism:totp", "state":"dvsPJX3HPLufKsflRcOEZqwYODt1wpRjjq9n4ewjxeeTlRJCs7d5x7HRa02OD8t9RAzAtqwXU4ILO09RqpeSb6TlulqKxdu...", "message":"", "exceptionMsg":"" } }
context
- The context variable provided to the Info Map. Required to save the inner policy execution context,
and fetch locale for translated messages.payload
- The policy payload as stringified JSON. Must include either the policy ID (PolicyId), or a state ID
(StateId), and other request parameters dependent on the policy being run. For example, the
"operation" parameter is required to complete most policies.stsuu
- The user identity to complete the policy with. Can be constructed as per usual for mapping rules, or
using one of the AuthSvcClient helper functions. See getRequestTokenAttrAsStsuu(Context)
and
getSimpleSTSUU(String)
public static java.lang.String executeInAccessPolicy(Context accessPolicyContext, java.lang.String payload, STSUniversalUser stsuu)
Example input payload with PolicyId: { "PolicyId": "urn:ibm:security:authentication:asf:totp" "operation": "verify", "otp": "123456" } Example input payload with StateId: { "StateId": "BQ4TUc6sIeuprD3ToVBCumClgcAwtGLlPPbdM0A49BBcCcriF2Pz85H5bQmz8KKPHXp2XAfdQMPB7MYTAJsEqu3Fu2xcN5j..." "operation": "verify", "otp": "123456" } Example response payload: { "status":"pause", "page":"\/authsvc\/authenticator\/totp\/login.html", "response": { "mechanism":"urn:ibm:security:authentication:asf:mechanism:totp", "state":"dvsPJX3HPLufKsflRcOEZqwYODt1wpRjjq9n4ewjxeeTlRJCs7d5x7HRa02OD8t9RAzAtqwXU4ILO09RqpeSb6TlulqKxdu...", "message":"", "exceptionMsg":"" } }
accessPolicyContext
- The context variable provided to the Access Policy. Required to save the inner policy
execution context, and fetch locale for translated messages.payload
- The policy payload as stringified JSON. Must include either the policy ID (PolicyId), or a
state ID (StateId), and other request parameters dependent on the policy being run. For
example, the "operation" parameter is required to complete most policies.stsuu
- The user identity to complete the policy with. Can be constructed as per usual for mapping
rules, or using one of the AuthSvcClient helper functions. See
getRequestTokenAttrAsStsuu(Context)
and getSimpleSTSUU(String)
public static STSUniversalUser getRequestTokenAttrAsStsuu(Context context)
context
- The context variable provided to the Info Map. Required to fetch identity tokens.public static STSUniversalUser getSimpleSTSUU(java.lang.String username)
username
- The username to set as the principal name of the new STSUniversalUser object.public static void prepareContextFromJson(JSONObject json, AuthSvcClientContextView contextView) throws BadRequestException, java.io.IOException
BadRequestException
java.io.IOException
public static JSONObject sessionToJSON(CleanableSession session)
public static void JSONToSession(java.lang.String jsonString, CleanableSession session)