AuthService
global with sharing class AuthService
Description
This class encapsulates methods to support Authorization for Docusign Apps Launcher
Methods
getLoginUrl
global static Url getLoginUrl(final String redirectTo)
Description
Generates a Docusign login URL where a user can grant consent to this application. The calling application should redirect the user to this URL. Once login is complete, the user will be redirected to the path specified by
redirectTo. The redirectTo parameter must be a path to a page in the current Salesforce org. The org domain base URL will be prepended to this. Upon redirect, two additional parameters are appended:
dfsle__status: eitherSuccessorFailure.dfsle__message: additional details in the case of failures.
The resulting URL is valid for only a single use by the current user.
Callers must be assigned the DocuSign Login permission set or better.
Example:
Url loginUrl = dfsle.AuthService.getLoginUrl('/apex/MyReturnPage');
// Redirect the user to loginUrl. There they can authenticate with Docusign and grant consent to the application.
// After successful authorization, the user is redirected to
// https://your-domain.my.salesforce.com/apex/MyReturnPage?dfsle__status=Success.
Returns
The Docusign login URL.
Parameters
redirectTofinal String redirectTo
Where to redirect the user to after login. This must be a local path to a page that will handle the authorization result.