Home

Traffic Server Software Developers Kit

The Basic Authorization Plugin

The sample basic authorization plugin, basic-auth.c, checks for basic HTTP proxy authorization. In HTTP basic proxy authorization, client user names and passwords are contained in the Proxy-Authorization header. The password is encoded using base64 encoding. The plugin checks all incoming requests for the authorization header, user name, and password. If the plugin does not find all of the these, then it reenables with an error (effectively stopping the transaction) and adds a transaction hook to the send response header event.

Creating the Plugin's Parent Continuation and Global Hook

The parent continuation and global hook are created as follows:

INKHttpHookAdd (INK_HTTP_OS_DNS_HOOK, INKContCreate (auth_plugin, NULL));