Manual set auth-token on the local server

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.

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

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

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

@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

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.

3 Likes

@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.”

testing, one min.

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:

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

“deadbeef” :rofl::rofl::rofl:

1 Like

: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

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.

even better!

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