Authors: Jean-Sébastien Pédron (js.pedron@meetic-corp.com).
References
The module exmpp_client_legacy_auth implements the initiating entity side of legacy authentication found in Jabber, before XMPP 1.0.
A common use case is presented in table 1.
Client-side | Server-side |
---|---|
Once a stream is opened, the client call Request = exmpp_client_legacy_auth:request("jabber.example.com"). After serialization, this produces this XML message: <iq type="get" to="jabber.example.com" id="auth-1905181425"> <query xmlns="jabber:iq:auth"/> |
|
The server answer with the available fields: Fields = exmpp_server_legacy_auth:fields(Request). After serialization, this produces this XML message: <iq xmlns="jabber:client" type="result" id="auth-1905181425"> <query xmlns="jabber:iq:auth"> <username/> <password/> <digest/> <resource/> </query> |
|
The client can send its credentials: Password = exmpp_client_legacy_auth:password( Fields, "johndoe", "foobar!", "home"
The best method is chosen automatically (here, After serialization, this produces this XML message: <q xmlns="jabber:client" type="set" id="auth-3105434037"> <query xmlns="jabber:iq:auth"> <username>johndoe</username> <digest> 93fdad2a795c59c73a6acf68a4dbdd3ddb366239 </digest> <resource>home</resource> </query> |
|
If the password is correct, the server notify the client: Success = exmpp_server_legacy_auth:success(Password). After serialization, this produces this XML message: <iq xmlns="jabber:client" type="result" id="auth-3105434037"/> |
digest/2 | Produce a password digest for legacy auth, according to XEP-0078. |
get_fields/1 | Return the list of fields supported by the server. |
get_prefered_auth/1 | Return the prefered authentication method. |
hex/1 | Encode list to a hexadecimal string. |
is_success/1 | Tell if the authentication succeeded. |
password/4 | Make an <iq/> to send authentication informations. |
password/5 | Make an <iq/> to send authentication informations. |
password_digest/3 | Make an <iq> to send authentication informations. |
password_digest/4 | Make an <iq> to send authentication informations. |
password_plain/3 | Make an <iq> to send authentication informations. |
password_plain/4 | Make an <iq> to send authentication informations. |
request/1 | Make an <iq> for requesting legacy authentication. |
request/2 | Make an <iq> for requesting legacy authentication. |
request_with_user/2 | Make an <iq> for requesting legacy authentication. |
request_with_user/3 | Make an <iq> for requesting legacy authentication. |
digest(ID, Passwd) -> Digest
Produce a password digest for legacy auth, according to XEP-0078.
get_fields(Fields_IQ) -> Fields
throws {legacy_auth, get_fields, invalid_iq, Fields_IQ} | {legacy_auth, get_fields, invalid_field, Field}
Return the list of fields supported by the server.
get_prefered_auth(IQ::Fields_IQ) -> Auth
Return the prefered authentication method.
hex(Plain) -> Hex
Encode list to a hexadecimal string.
is_success(IQ) -> bool()
Tell if the authentication succeeded.
password(Fields_IQ, Username, Password, Resource) -> Password_IQ
Make an <iq/>
to send authentication informations.
password(Fields_IQ, Username, Password, Resource, ID) -> Password_IQ
Make an <iq/>
to send authentication informations.
password_digest(Username, Password, Resource) -> Password_IQ
Make an <iq>
to send authentication informations.
password_digest(Username, Password, Resource, ID) -> Password_IQ
Make an <iq>
to send authentication informations.
Password
is encoded as specified in XEP-0078.
password_plain(Username, Password, Resource) -> Password_IQ
Make an <iq>
to send authentication informations.
password_plain(Username, Password, Resource, ID) -> Password_IQ
Make an <iq>
to send authentication informations.
Password
is in clear plain text in the stanza.
Password
may be the empty string.
request(To) -> Request_IQ
Make an <iq>
for requesting legacy authentication.
request(To, ID) -> Request_IQ
Make an <iq>
for requesting legacy authentication.
request_with_user(To, Username) -> Request_IQ
Make an <iq>
for requesting legacy authentication.
request_with_user(To, Username, ID) -> Request_IQ
Make an <iq>
for requesting legacy authentication.
Generated by EDoc, Jan 21 2011, 01:43:54.