librelist archives

« back to archive

Programmatically login as a particular user

Programmatically login as a particular user

From:
Simon Hill
Date:
2015-04-08 @ 00:56
I would like to take advantage of the new prebind functionality in 0.9 to
avoid having to support that on the server.

https://conversejs.org/docs/html/configuration.html#prebind

How do I specify the password? I must be confused.

Thanks for any clarification.
Si

Re: [conversejs] Programmatically login as a particular user

From:
paparazzia
Date:
2015-04-08 @ 04:28
Hello,

Prebind is useful when your users are already authenticated on your web
site.

User authenticate on your site. It owns a session. Then you have a prebind
script (server side) that knows the credentials (usually from a user
database) , perform the xmpp login, and return tokens when called from
converse.

I'm using the php prebind script listed in converse documentation.
The two things that I had to tweak were:
- force prebind lib to use plain. I don't know why it didn't want with
others mode.
- my password are stored hashed in user db. Thus I had to make my xmpp
server accept both hashed (for pre bind, as my website knows nothing else)
and not hashed passwords (for desktop xmpp clients, as users obviously
provide their true password and not the hashed one).


I would like to take advantage of the new prebind functionality in 0.9 to
avoid having to support that on the server.

https://conversejs.org/docs/html/configuration.html#prebind

How do I specify the password? I must be confused.

Thanks for any clarification.
Si

Re: [conversejs] Programmatically login as a particular user

From:
Jc Brand
Date:
2015-04-09 @ 12:21
Thanks paparazzia for the explanation. Just to add to that, I've just merged
the "anon_login" branch, which besides providing anonymous login also allows
you to automatically log in if you can pass the username and password into
converse.js.

I explained briefly how to do this to Safia in my previous email to this list.

Some more info here:
https://conversejs.org/docs/html/configuration.html#auto-login

Regards
JC

On Wed, Apr 08, 2015 at 06:28:42AM +0200, paparazzia wrote:
>    Hello,
> 
>    Prebind is useful when your users are already authenticated on your web
>    site.
> 
>    User authenticate on your site. It owns a session. Then you have a prebind
>    script (server side) that knows the credentials (usually from a user
>    database) , perform the xmpp login, and return tokens when called from
>    converse.
> 
>    I'm using the php prebind script listed in converse documentation.
>    The two things that I had to tweak were:
>    - force prebind lib to use plain. I don't know why it didn't want with
>    others mode.
>    - my password are stored hashed in user db. Thus I had to make my xmpp
>    server accept both hashed (for pre bind, as my website knows nothing else)
>    and not hashed passwords (for desktop xmpp clients, as users obviously
>    provide their true password and not the hashed one).
> 
>    I would like to take advantage of the new prebind functionality in 0.9 to
>    avoid having to support that on the server.
>    [1]https://conversejs.org/docs/html/configuration.html#prebind
>    How do I specify the password? I must be confused.
>    Thanks for any clarification.
>    Si
> 
> References
> 
>    Visible links
>    1. https://conversejs.org/docs/html/configuration.html#prebind

Re: [conversejs] Programmatically login as a particular user

From:
Simon Hill
Date:
2015-04-09 @ 13:01
Fantastic thank you.






On Thu, Apr 9, 2015 at 5:21 AM -0700, "JC Brand" <lists@opkode.com> wrote:










Thanks paparazzia for the explanation. Just to add to that, I've just merged
the "anon_login" branch, which besides providing anonymous login also allows
you to automatically log in if you can pass the username and password into
converse.js.

I explained briefly how to do this to Safia in my previous email to this list.

Some more info here:
https://conversejs.org/docs/html/configuration.html#auto-login

Regards
JC

On Wed, Apr 08, 2015 at 06:28:42AM +0200, paparazzia wrote:
>    Hello,
> 
>    Prebind is useful when your users are already authenticated on your web
>    site.
> 
>    User authenticate on your site. It owns a session. Then you have a prebind
>    script (server side) that knows the credentials (usually from a user
>    database) , perform the xmpp login, and return tokens when called from
>    converse.
> 
>    I'm using the php prebind script listed in converse documentation.
>    The two things that I had to tweak were:
>    - force prebind lib to use plain. I don't know why it didn't want with
>    others mode.
>    - my password are stored hashed in user db. Thus I had to make my xmpp
>    server accept both hashed (for pre bind, as my website knows nothing else)
>    and not hashed passwords (for desktop xmpp clients, as users obviously
>    provide their true password and not the hashed one).
> 
>    I would like to take advantage of the new prebind functionality in 0.9 to
>    avoid having to support that on the server.
>    [1]https://conversejs.org/docs/html/configuration.html#prebind
>    How do I specify the password? I must be confused.
>    Thanks for any clarification.
>    Si
> 
> References
> 
>    Visible links
>    1. https://conversejs.org/docs/html/configuration.html#prebind