I am building a website to login Blynk server using user email and password but kind of stuck. I am trying the blynk javascript library (https://github.com/vshymanskyy/blynk-library-js) and modify the library to support user login and load user profile with list of projects and devices.
When I tried to send message from browser with format [LOGIN email hashed_password], it failed and following log is found on blink server:
15:54:08.297 TRACE- HTTPS connection detected.
15:54:08.297 TRACE- Mapping from /websockets to /websockets
15:54:08.297 TRACE- In http and websocket unificator handler.
15:54:08.297 TRACE- Initialized secured hardware websocket pipeline. [WSIdleStateHandler, SslHandler#0, HttpsServerCodec, HttpsServerKeepAlive, HttpsObjectAggregator, WSChannelState, io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandshakeHandler, io.netty.handler.codec.http.websocketx.Utf8FrameValidator, WSWebSocketServerProtocolHandler, WSWebSocket, WSMessageDecoder, WSSocketWrapper, WSMessageEncoder, WSLogin, WSNotLogged, DefaultChannelPipeline$TailContext#0]
15:54:08.325 TRACE- Incoming LoginMessage{id=1, command=Login, body=‘xxx@mail.comY1wDUPw8ZpQRP/hEm3oMlwnlr+TqKG0zpEwCf4aE0gQ=’}
15:54:08.325 DEBUG- HardwareLogic token is invalid. Token ‘xxx@mail.comY1wDUPw8ZpQRP/hEm3oMlwnlr+TqKG0zpEwCf4aE0gQ=’, ‘/116.102.140.185:52116’
When logging from mobile app, it’s ok using same hashed password:
15:55:32.741 TRACE- Blynk protocol connection detected.
15:28:02.298 TRACE- Incoming LoginMessage{id=1, command=Login, body=‘xxx@gmail.comY1wDUPw8ZpQRP/hEm3oMlwnlr+TqKG0zpEwCf4aE0gQ=Android2.26.7Blynk’}
15:28:02.298 DEBUG- Re registering app channel. [id: 0x015c1488, L:/10.148.0.2:9443 - R:/116.102.140.185:33886]
15:28:02.299 INFO - xxx@gmail.com Blynk-app (android-22607) joined.
15:28:02.350 TRACE- Incoming id=2, command=LoadProfile, body=’’
15:28:02.351 TRACE- Incoming id=3, command=GetEnergy, body=’’
15:28:02.443 TRACE- Incoming id=4, command=AddPushToken, body=‘142684875761a841f8ae711f8dfLIQy-FYXpU:APA91bGZmrIgaL3y7BfviiPlV8gwSMRtquN9YP3otdFLp9TBpRtNPzqPwarff04N4uZl-BPu0J7Twlo-4Z8buSaIp6fVfPh-g0UCE_JAu1TdGMyAR9ZqYDl28KgcsZRNNabO-plmicfojQ8tZTiCHvSX4n0aKYsaUQ’
15:28:02.444 TRACE- Incoming id=5, command=AppSync, body=‘1426848757’
Can anyone give me a hint how to write javascript to login and load devices from browser? Thanks