Skip to content

How to authenticate in the connection? #58

Answered by ra1u
Gabsop asked this question in Q&A
Discussion options

You must be logged in to vote

First command you send should be auth.

conn.connectSecure(<args>).than((Command command){
     command.send_object(["AUTH","username","password"])
     .then((var response) {
       print(response);
       command.send_object(["SET","token","value]).then(
          (var response) => print(response));
     });
});

Or equivalently using async

Command command = await conn.connectSecure(<args>);
var rsp_auth = await command.send_object(["AUTH","username","password"]);
print(rsp_auth);
var rsp_token = await command.send_object((["SET","token","value]));
print(rsp_token);

I did not compile this, so let me know how this works for you.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Gabsop
Comment options

@ra1u
Comment options

@Gabsop
Comment options

Answer selected by Gabsop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #57 on March 08, 2022 19:12.