Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

The HTTP plugin provides different authentication methods for the defined datapointsdata points. Although, in some APIs the client request needs to provide authentication information, otherwise the server responds to a client with a 401 (Unauthorized) response.

In the normal HTTP Basic Authentication. each datapoint can provide a username and password to prove their authentication in (Authentication User, Authentication Password) fields. But some Servers provide tokens, the next 2 examples will handle tokens in both (Basic Authentication, OAuth2 Authentication).

...

Info
Authorization: Basic YmRmODRjNzBhYzI0NDM5ZDgyOTE5M2FiMjI1NDBhMDE6OWI2MTYzMEQ3NmUxNEQ1Mzk0MjgwMTdkNzZBRjhmODY=

...

OAuth2 Authentication

If Datapoint needs to make calls from API that has OAuth 2.0 as authorization protocol

HTTP Basic/Digest Authentication 

HTTP basic authentication is the traditional way to authenticate to an HTTP using username and password. To configure HTTP basic authentication, just add your username and password to appropriate columns within the HTTP data point definitions.

Image Added

The HTTP plugin will authenticate to the given HTTP server and retrieve the HTTP basic access token and sends it in HTTP request that is used to retrieve the HTTP content.

Older HTTP server may use HTTP digest authentication instead of HTTP basic authentication. To use digest authentication, you have to set the authentication method within the data point definitions:

Image Added

Adding the basic authentication token directly to the HTTP header

If you already have the basic authentication token (instead of username and password), it can be added to the HTTP header directly. To do so, set the "Additional HTTP Headers" column to the following:

Code Block
Authorization: Basic <your HTTP token>

For example:


Image Added

Info

Please keep in mind that this method is only necessary if you do not have username and password.


OAuth2 using Bearer Authentication

If a data point needs to make calls to an API that has enable OAuth 2.0 Bearer authentication, you will need also an access token. When passing the access token in an  To do so, set the "Additional HTTP Headers"  with the Authorization header that contains the word Bearer followed by a space and the token.column to the following:

Info
Authorization: Bearer YmRmODRjNzBhYzI0NDM5ZDgyOTE5M2FiMjI1NDBhMDE6OWI2MTYzMEQ3NmUxNEQ1Mzk0MjgwMTdkNzZBRjhmODY=

...

: Bearer <your authentication token>

For example:

Image Added