BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Manual set auth-token on the local server

#1

Hello, prompt please as it is possible to set or change Auth Token on the local server. The thing is that I installed a local blynk server on the new hardware, and used the barcode of my project to transfer, but the tokens have changed, and there is no easy access to the devices at the moment. Saw this subject [Custom Auth Token] but I did not understand where and how to change the token.

0 Likes

Several questions regarding Local Blynk Server
#2

in your code, just replace the old Auth with the new one and reload it in the MCU.

0 Likes

#3

Thank you, I understand how to change the auth token on my NodMCE, ESP devices in the code, but access to them is difficult, and I have not provided the ability to fill sketches over wifi. The task to change the automatically generated token-local server on the old

0 Likes

#4

I’m not sure that we can change the auth on server side.
Maybe @Gunner knows ?

0 Likes

listed #5
0 Likes

#6

@shamsr that post you referenced was a long time ago… I suspect things changed after that since the only way to create a new token is via the App, and you must place said token into your sketch and re-upload it. 2nd EDIT - see further below for a workaround.

That all said, the Local Server is open sourced, but hacking the existing AUTH tokens (EDIT - in the App) is probably a programming level or two beyond the scope of this forums teaching.

1 Like

#7

If it is ONLY the token that has changed, in the data directory of the local server is a file “your@email.user”.

pull it up in nano or notepad , or whatever. search for the string, or the word “token” and replace the token in the text file. Restart your server.

2 Likes

#8

@lvennard The issue there is that the App seems to override and replace the modified AUTH in that file with what it believes is the correct one, as generated upon device/project creation (I have tested this).

@shamsr So what I should have basically said was, “Since the App seems to be an integral part of the AUTH process, and is Closed Source, then basically the answer is… No it is unlikely that it can be done by us users.”

0 Likes

#9

testing, one min.

0 Likes

#10

Opps… :blush: … I had missed a critical step or two… shut off App, restart server, then restart App.

End result is that I now have the cloned project working on original AUTH (thus changing the OP answer to YES)… Although the doner, still with the same (original AUTH) is offline… I guess only one project can use same AUTH at one time… that last one with that AUTH in the user file.

So, I give all credit to @lvennard :smiley:

0 Likes

#11

Check out my new Auth :slight_smile:

Stop the server. If you dont stop the server, it will try to write to the file during your edits.

edit your file.

restart the server

1 Like

#12

deadbeef:rofl::rofl::rofl:

1 Like

#13

:slight_smile: thanks brotha, its all good.

One more note, for “custom” tokens… im pretty sure they are in hex. so that means you can only use 0-9 and a-f as characters.

1 Like

#14

Hmm, it looks like you can use any text.

This is working…

image image

Not sure how this is of any real benefit, aside from the OPs issue (which could have other consequences due to old library over time, etc.)… but perdy neat anyhow.

0 Likes

#15

even better!

0 Likes

#16

Thank you very much guys, saved me from working in the cold - 30* C :slight_smile:

0 Likes