Skip to content

apigrove GUI API IP Whitelist authentication

Bradley Wangia edited this page Sep 28, 2012 · 2 revisions

Purpose

This apiGrove tutorial demonstrates how to use an IP Whitelist to restrict access your API.

Prerequisites

Please ensure the following prerequites are met

  • A working install of apiGrove and apiGroveGUI
  • A web browser

Instructions

Create the API

  1. Open your installed apiGrove GUI url in a browser
  2. Login to apiGroveGUI /dev/images/apiGroveGUI_Login.png
  3. Click on API in the top menu
  4. Click Create New
  5. Enter a Name for your API 'myWhitelistTweets'
  6. Enter an Endpoint
  7. Enter the target host where this API is hosted
  8. Click Advanced button /dev/images/apiGroveGUI_APIWhitelist.png
  9. Click The Enabled button (makes your API active immediately upon creation)
  10. Click the ‘Whitelist’ button for Authenitcation Type
  11. Leave the HTTPS button unclicked
  12. Enter 9 for the Transactions Per Second (TPS) Threshold
  13. Enter 10 for the Transactions Per Minute (TPM) Threshold
  14. Select the GET button for allowed HTTP calls
  15. Click Save
  16. apiGrove GUI returns a success message and lists your onboarded API

Create the Auth

  1. Click on Auth in the top menu
  2. Click Create New
  3. Enter an ID 'whitelisttwitter' for this auth
  4. Enter a comma separated list of IP (be sure to include your IP for testing!)
  5. Click Save
  6. 'whitelisttwitter' is displayed in a listing of your auths

Create a policy

The policy associates the auth with your API.

  1. Click on Policy in the top menu
  2. Click Create New
  3. Enter ID twittterWhitelistPolicy
  4. Select the API created in earlier steps
  5. Select the Auth created
  6. Click submit query
  7. Attempting to access the API from an IP not on the whitelist returns a unauthorized message (remove your API from the whitelist for this test)
  8. Accessing the API with the correct username and password returns search results from the twitter API