...
Section |
---|
Custom Tagging PageThis page is fully implemented in the custom web application for DMS tagging. The fact that it looks like the eSignAnyWhere Web UI is just because it was implemented that in a sample code. This is purely part of the custom DMS tagging sample. In a simple webform, this can look like: |
Section |
---|
|
Section |
---|
Document InboxAfter the envelope is sent, the custom web app is redirecting to the eSignAnyWhere document inbox. This is standard eSignAnyWhere functionality; the custom web application just needs to redirect to that page once done. Note if you want to cancel the settings: Application Flow – Callback HandlerAfter the callback for finished envelope was received, the callback handler should check if it was a completed action. The handler has to retrieve the envelope ID from the HTTP GET parameters. Then, the callback handler should note down the envelope ID in a persisted storage for further processing and return with an HTTP 200 (success) to indicate the archiving request was noted down. |
Section |
---|
Section | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Please see the following descriptions for the implementation in detail.
Once done, the implementation should note down in the list of envelopeIds noted down above, that the processing was completed. Once completed, the callback handler implementation should delete the envelope from eSignAnyWhere. Alternatively, a data retention job can be configured on the organization to perform an automatic cleanup (but then w/o checking if the documents are already stored in the DMS). OAuth2 Code Grant Flow for API AuthenticationA common situation is that the eSignAnyWhere user is redirected to a custom web application which should deal with the envelope sent before via eSignAnyWhere Web UI. To access the envelope via API, the custom web application must authenticate to the API with a user that has the permission to access the envelope. While this was difficult in the past and often required to keep records of a mapping of envelopes to the creator, this got much simpler since eSignAnyWhere supports the OAUth2 Code Grant authentication flow. The user of the custom web application is asked to authenticate, via OAuth2, with the eSignAnyWhere user credentials. As a result, a code sharing between eSignAnyWhere and the custom web application is triggered and as a result the custom web application gets API credentials to access the envelope. During authentication, the user may choose the wrong user account on eSignAnyWhere – therefore it is required to check the permissions for the envelope, and redirect to the authentication again if the authentication provided does not have the required permissions. The OAuth2 Code Grant Flow is implemented as specified in RFC 6749, Chapter 4.1 – see https://tools.ietf.org/html/rfc6749#section-4.1 Note that the tagging page, when responding with a HTTP 302 redirect to the Authorization page, provides itself as redirect_uri which is again called after authentication. But in the 2nd invocation, no dynamic HTTP GET arguments such as the envelopeId can be provided because the OAuth application configuration in eSignAnyWhere AdminWeb must already whitelist the full URL including all parameters. Therefore, the sample application is encoding all GET arguments from first call into the “scope” parameter of the authentication call. The redirect_uri is invoked with the scope parameter, as specified in RFC 6749. So the scope is used in that case to transport all the GET parameters. The callback handler implementation also requires to know the API Token (Bearer Token) of the sender to retrieve signed documents, audit trail etc. – therefore the DMS Tagging Page implementation is already storing a mapping between envelopeId and senderUser and also a bearertoken of the senderUser in its persistent storage. TroubleshootingOAuth Authorization Error: ‘redirect_uri’ does not match any of the configured urls“The provided url ‘redirect_uri’ does not match any of the configured urls of the OAuth application.”: The exact URL of the web application has to be configured in the OAuth Application configuration, available in the AdminWeb. |
...