Basic Authentication Implementation in IBM API Connect
In this blog, we will describe how to use Basic authentication implementation to secure APIs using IBM API Connect.
- LogOn To API Manager and Click On Resources, Go to user registries click on Create
- You will find 4 types of User Registries and click on “Authentication URL user registry”
Fill in the basic details like Title and Display_Name and Authentication URL
We used the following website’s sample authentication URL here:
http://httpbin.org/#/Auth/get_basic_auth__user___passwd_
Click On Save, Go to Manage, and Click on Sandbox
Click on Catalog Settings shown in the Top Bar of the Catalog
In the Left Panel, you can see API user registries, click on it
Click on Edit Click the check box of Created user registry and Click on Save.
- Go to Develop Tab and click on Create API and Fill in the Basic details like name, title and base path, etc
Go to the security schemes shown in the left panel of the API
Click on Add and Give the Security Definition Name and Select the Definition Type as “Basic” from the dropdown.
Click on Create.
Scroll Down and add the Basic auth User registry in Authenticate using User Registry
Go to Security in the left panel of API and click on Add and Select Created Basic Auth Security
Click on Create
Testing:
Go to Explorer, click on POST and Click on Try It.
Provide the UserName and Password of the Authentication URL and Give the request click on Send.
Provide the wrong credentials and try to consume the API you’ll get an Error Response.