requestOperationAuthorization
Initiates a multi-factor authorization process.
This is suitable for all modules of business service components.
Syntax
Copy
function requestOperationAuthorization(recordID: string, authOperationTypeName: string, initialStatusID: string, authorizedStatusID: string, rejectedStatusID: string, mobilePhone: string): IFtosReqAuthResponse
| Parameter |
Type |
Description |
|---|---|---|
recordID
|
string |
ID of the bearer entity record that undergoes the authorization operation. |
authOperationTypeName
|
string |
Action authorization type associated with the authorization operation. For details, see the Studio User Guide. |
initialStatusID
|
string |
Business workflow status ID that the record must be in to initiate the authorization operation. For details, see the Studio User Guide. |
authorizedStatusID
|
string |
Business workflow status ID that will be assigned to the record if the user authorizes the operation. For details, see the Studio User Guide. |
rejectStatusID
|
string |
Business workflow status ID that will be assigned to the record if the user rejects the operation. For details, see the Studio User Guide. |
mobilePhone
|
string |
Telephone number where the one-time-password is sent. If not specified, the password is delivered to the user account's default telephone number. |
Return Value
Returns a IFtosReqAuthResponse JSON object containing details about the authorization.
Copy
{
afterGenerateJs: string;
authSessionId: string;
template: string;
}
| Property | Type | Description |
|---|---|---|
afterGenerateJs
|
string | After Generate JS content of the authorization page set up for the request's authorization type. For more information, see the Studio User Guide. |
authSessionId
|
string | Unique ID of the authorization session. |
template
|
string | HTML content of the authorization page set up for the request's authorization type. The returned value has template tokens replaced with their actual values. For more information, see the Studio User Guide. |
Examples
In this example:
- We initiate a multi-factor authorization for the bearer entity record in the current client-side process. For more information, see ftos.context.
- The authorization type is defaultMFA.
- The initial business status of the record is Pending. Depending on the result of the authorization, the record will transition to either the Authorized or Rejected status. All business statuses belong to the Payments entity. For more information on how to retrieve the ID of a business status, see ftos.businessStatusWorkflow.getId.
- We save the state of the authorization operation in a variable called reqResponse and we use the ftos.context.response.setData function to send the information to the client side call-back function.
Copy
var reqResponse = requestOperationAuthorization(ftos.context.id, 'defaultMFA',
ftos.businessStatusWorkflow.getId('Payments', 'Pending'), ftos.businessStatusWorkflow.getId('Payments', 'Authorized'), ftos.businessStatusWorkflow.getId('Payments', 'Rejected'));
ftos.context.response.setData({requestAuthResponse: reqResponse});