After installing the SRP HTTP Framework you will want to do some preliminary configuration changes. Other than changes to the authentication method, all configuration is managed in the SRP_HTTP_FRAMEWORK_SETUP record which is found in the SYSENV table. As of v3 of the SRP HTTP Framework, the configuration values can be set using the NDW_HTTP_FRAMEWORK_SETUP form:

Prior to v3, simply use the record editor of your choice to make these change. These configuration details inform SRP HTTP Framework how to operate your web services properly. Here is a quick start guide on configuring the specific attributes in this record:

<1> - Home URL - Enter the URL for the main site. For example: https://www.mysite.com. Note, do not include parts of the URL that point to the API entry point, unless the main site is the entry point.

<2> - API URL - Enter the URL segment that defines the entry point for the API. For example: /api. SRP HTTP Framework will merge the Home URL with the API Root URL to create a complete URL for hypermedia responses: e.g., https://www.mysite.com/api.

<3> - Capture Path - Enter the OS directory path on the server where you want copies of requests and responses to be stored. These are useful for troubleshooting. You can leave this blank if you do not want to capture anything.

<4> - Enable Authentication - Keep this unchecked if you want to disable authentication. Normally, this should only be done for testing purposes.

<5> - Realm Value - Typically this is the name of the application. This is used by some browsers to inform the user what realm they are connecting to.

<6> - Entry Point Service - Enter the name of the entry point service you wish to use. If left empty. HTTP_Entry_Point_Services will be used. Other than testing multiple entry points, there should be no reason to change this.

If you choose to disable authentication for now then you do not need to do anything else. You will be able to successfully call your APIs without any authentication. Otherwise, you will need to open the HTTP_Authentication_Services stored procedure and examine it to see if the method of authentication will work for you. If you are not using SRP FrameWorks, it is likely you will need to modify this since it was designed to perform an HTTP Basic Authentication validation against the SRP FrameWorks USERS database table. Alternatively, you can update HTTP_Authentication_Services as follows:

  1. Replace the HTTP Basic Authentication logic to support another authentication protocol. While HTTP Basic Authentication is recommended for REST APIs, your application might require something like OAuth.

  2. Keep the HTTP Basic Authentication logic, but update it to pull the credentials from a database table that is a part of your application.

Once the above configuration details are in place, you are ready to start building functional web APIs, but we recommend you go through some preliminary testing to make sure there are no surprises.

  • No labels