3

In the below Blynk program, they have used the line:

char auth[] = "76aeba5832304e10917b4e1748c34039";

What is mean by the 'auth token'? Why is it required for Blynk to function correctly?

Program

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
int ledPin = 13;
int buttonPin = 4;

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "76aeba5832304e10917b4e1748c34039";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Maximus";
char pass[] = "Acc1234$$";

void setup()
{
   pinMode(ledPin, OUTPUT);
   Serial.begin(9600);
   Blynk.begin("76aeba5832304e10917b4e1748c34039", "Maximus", "Acc1234$$");
}
0
1

On your mobile and on your program you have to have something shared only with that pair (=identity of it) that says they belong together.

AFAIK Blynk has a middleware communicating between these two instances and you'll have the token as a some kind of IoT address.

1

The documentation for Blynk seems relatively clear about the purpose:

Auth Token is a unique identifier which is needed to connect your hardware to your smartphone. Every new project you create will have its own Auth Token. You’ll get Auth Token automatically on your email after project creation. You can also copy it manually.

When you create a new project, you can either copy the token out of the app, or email it to yourself. Either way, that token identifies your device and functions as 'proof' that your device is who it says it is.

A more generic rundown on token based authentication can be found on Stack Overflow, which might be useful for context. Essentially, treat it as a 'username and password in one' for your device, and make sure it's kept safe, otherwise you'll have security problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.