AWS IoT MQTT Custom Authentication

From sgcWebSockets 4.4.3, Amazon AWS IoT MQTT component supports custom authentication, so from this version all MQTT protocols are supported.

  1. MQTT over WebSockets
  2. MQTT over TCP
  3. X.509 certificate authentication
  4. Signature V4 authentication
  5. Custom Authentication

Protocols Supported 

 The following table lists the protocols that the AWS IoT device endpoints support and the authentication methods and ports they use.

Custom Authentication 

AWS IoT Core lets you define custom authorizers so that you can manage your own client authentication and authorization. This is useful when you need to use authentication mechanisms other than the ones that AWS IoT Core natively supports. For example, if you are migrating existing devices in the field to AWS IoT Core and these devices use a custom bearer token or MQTT user name and password to authenticate, you can migrate them to AWS IoT Core without having to provision new identities for them. You can use custom authentication with any of the communication protocols that AWS IoT Core supports.

Example: if you want to use MQTT username and password to authenticate

oIoT := TsgcIoTAmazon_MQTT_Client.Create(nil);
oIoT.MQTTAuthentication.Enabled := True;
oIoT.MQTTAuthentication.Username := 'user';
oIoT.MQTTAuthentication.Password := 'password';
oIoT.CustomAuthentication.Enabled := True;
oIoT.CustomAuthentication.WebSockets := True;
oIoT.CustomAuthentication.Parameters := '/mqtt';
oIoT.Active := True; 

Example: if you want to send a bearer token

oIoT := TsgcIoTAmazon_MQTT_Client.Create(nil);
oIoT.CustomAuthentication.Enabled := True;
oIoT.CustomAuthentication.WebSockets := True;
oIoT.CustomAuthentication.Parameters := '/mqtt';
oIoT.CustomAuthentication.Headers.Text := 'Authorization: Bearer AbCdEf123456';
oIoT.Active := True; 

Delphi Amazon AWS IoT Client Component

Client Amazon AWS IoT MQTT, check documentation, download sample and more.
×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

HTTP/2 Initial Server Support
AWS IoT MQTT Signature V4

Related Posts