title: usage of libstrophe library for xmpp
body: <p>I am trying to create a chat client in C using Libstrophe. I have referred to the following code example given at <a href="https://github.com/metajack/libstrophe/blob/master/examples/active.c" rel="nofollow">https://github.com/metajack/libstrophe/blob/master/examples/active.c</a>
  The code has a call to xmpp_connect_client(...) to establish a connection with the xmpp server.</p>
  
  <pre><code> int main(int argc, char **argv)
   {
  xmpp_ctx_t *ctx;
  xmpp_conn_t *conn;
  
  if (argc != 3) {
      fprintf(stderr, "Usage: active &lt;jid&gt; &lt;pass&gt;\n\n");
      return 1;
  }
  
  /* initialize lib */
  xmpp_initialize();
  
  /* create a context */
  ctx = xmpp_ctx_new(NULL, NULL);
  
  /* create a connection */
  conn = xmpp_conn_new(ctx);
  
  /* setup authentication information */
  xmpp_conn_set_jid(conn, argv[1]);
  xmpp_conn_set_pass(conn, argv[2]);
  
  /* initiate connection */
  xmpp_connect_client(conn, "talk.google.com", 0, conn_handler, ctx);
  
  /* start the event loop */
  xmpp_run(ctx);
  
  /* release our connection and context */
  xmpp_conn_release(conn);
  xmpp_ctx_free(ctx);
  
  /* shutdown lib */
  xmpp_shutdown();
  
  return 0;
  </code></pre>
  
  <p>}
  But where does the authentication take place? I looked up the source code for libstrophe and found C file auth.c 
  <a href="https://github.com/metajack/libstrophe/blob/master/src/auth.c" rel="nofollow">https://github.com/metajack/libstrophe/blob/master/src/auth.c</a>
  that has a function called _auth(..).
  I tried using _auth(..) in my code but it does not perform authentication properly. i.e. it does not notify me of wrong user-name or password. 
  Can any one suggest me the right way to authenticate my entity.</p>