HTTP Basic Authentication - Deprecated

This page discusses the DevKit’s support for HTTP basic authentication, and how to implement a connector that uses HTTP Authentication RFC-2617 to authenticate with your API.

HTTP Basic authentication is the simplest technique for enforcing access control to web resources. It uses static, standard HTTP headers which means that no handshakes have to be done in anticipation.

Prerequisites

This document assumes you are familiar with the Anypoint Connector DevKit and you are ready to implement authentication on your connector. It assumes you are familiar with the various authentication methods and you are using HTTP basic authentication to authenticate with your API.

@HttpBasicAuth Annotation

To implement HTTP basic authentication on your Connector you need to create a new class and annotate it with @HttpBasicAuth.

The following table describes all parameters for the @HttpBasicAuth annotation.

Parameter

Description

Required?

Default Value

friendlyName

Defines the name that is going to be displayed in the connector configuration pop up.

✓

configElementName

Defines the name for the configuration that is going to be used in the mule app.

config

headerName

Name of the header that contains the username and password encoded in Base64

@HttpBasicAuth Required Class Properties

Your Strategy class needs @Configurable instance properties to allow the user to specify their username and password, when using the connector as shown above:

@BasicAuthUsername holds the username

@BasicAuthPassword holds the password

Important: Ensure these instance variables have public getters and setters (not shown).

@HttpBasicAuth Only for @Restcall @Processor (Deprecated)

As HTTP Basic Authentication is a method for an HTTP user agent that provides a username and password when making a request using static standard HTTP headers. You can only use this authentication method for REST call operations.

See Also

In this topic:

Sign up for our Dev newsletter

MuleSoft provides the most widely used integration platform for connecting SaaS and enterprise applications in the cloud and on-premises. Delivered as a packaged integration experience, CloudHub™ and Mule ESB™ (Enterprise Service Bus) are built on proven open source technology for the fastest, most reliable on-premises and cloud integration without vendor lock-in.