To create a custom authentication mechanism to use with REST APIs, do the following.
Prerequisites
- You are using webHttp binding to make REST API
calls.
How to Start
- Open Microsoft Visual Studio.
- In Visual Studio, click New Project.
Procedure
- In the New Project window, click Class Library.
- Click OK.
- Add a reference to Ascentn.Workflow.WFBase.dll.
- Implement the interface IWFServiceBindingFactory, as in the following example:
public class RESTADAuthenticationFactory : IWFServiceBindingFactory
- Implement the method
public bool CheckAuthenticated(), including the following details:
- Write your own logic to validate the user
credential (you might be getting the headers in the request).
- Return true if user is authenticated.
- Build your .dll file.
- Copy your .dll file to the folder
[AgilePoint Server installation folder]\bin
- On the AgilePoint Server machine, click Start > All Programs > AgilePoint > AgilePoint Server Manager.
- On the AgilePoint Server Manager window, select your AgilePoint Server
instance.
- On the right pane, click the REST Port Information tab.
- On the REST Port Information tab, click Browse.
- On the Global Extended Module window, click the Ellipses.
- Select your custom authentication .dll file, and click OK.
- On the AgilePoint Server Manager window, click Update.