Compare commits
2 Commits
a330e7df29
...
8384410023
| Author | SHA1 | Date |
|---|---|---|
|
|
8384410023 | |
|
|
5fa7fe5235 |
|
|
@ -34,6 +34,7 @@ XMPP
|
||||||
* __xmpp_secret__ : Account password
|
* __xmpp_secret__ : Account password
|
||||||
* xmpp_debug : Enable debug log at true (default: false)
|
* xmpp_debug : Enable debug log at true (default: false)
|
||||||
* xmpp_verify_cert_validity : Enable certificate verification (default: true)
|
* xmpp_verify_cert_validity : Enable certificate verification (default: true)
|
||||||
|
* xmpp_default_lang : Message default languages
|
||||||
|
|
||||||
HTTP
|
HTTP
|
||||||
* http_port : HTTP port to bind (default: -1, desactive: -1)
|
* http_port : HTTP port to bind (default: -1, desactive: -1)
|
||||||
|
|
@ -48,6 +49,9 @@ __Bold config__ are mandatory.
|
||||||
|
|
||||||
If ``http_bind_address_ipv4`` is set to ``0.0.0.0``, it will bind all address on IPv4 __AND__ IPv6.
|
If ``http_bind_address_ipv4`` is set to ``0.0.0.0``, it will bind all address on IPv4 __AND__ IPv6.
|
||||||
|
|
||||||
|
The lang messages file must be placed into the same directory than the configuration file.
|
||||||
|
An example of this file can be found in [the repos](https://git.kingpenguin.tk/chteufleur/HTTPAuthentificationOverXMPP/src/master/messages.lang)
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
To ask authorization, just send an HTTP request to the path ``/auth`` with parameters:
|
To ask authorization, just send an HTTP request to the path ``/auth`` with parameters:
|
||||||
* __jid__ : JID of the user (user@host/resource or user@host)
|
* __jid__ : JID of the user (user@host/resource or user@host)
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ func (confirmation *Confirmation) askViaMessage() {
|
||||||
m := xmpp.Message{From: jid.Full(), To: confirmation.JID, Type: xmpp.MessageTypeNormal}
|
m := xmpp.Message{From: jid.Full(), To: confirmation.JID, Type: xmpp.MessageTypeNormal}
|
||||||
m.Thread = xmpp.SessionID()
|
m.Thread = xmpp.SessionID()
|
||||||
confirmation.setBodies(&m)
|
confirmation.setBodies(&m)
|
||||||
m.Confir = &xmpp.Confirm{Id: confirmation.Transaction, Method: confirmation.Method, URL: confirmation.Domain}
|
m.Confirm = &xmpp.Confirm{Id: confirmation.Transaction, Method: confirmation.Method, URL: confirmation.Domain}
|
||||||
|
|
||||||
log.Printf("%sSend message %v", LogInfo, m)
|
log.Printf("%sSend message %v", LogInfo, m)
|
||||||
WaitMessageAnswers[confirmation.Transaction] = confirmation
|
WaitMessageAnswers[confirmation.Transaction] = confirmation
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ func mainXMPP() {
|
||||||
case *xmpp.Presence:
|
case *xmpp.Presence:
|
||||||
|
|
||||||
case *xmpp.Message:
|
case *xmpp.Message:
|
||||||
confirm := v.Confir
|
confirm := v.Confirm
|
||||||
if confirm != nil {
|
if confirm != nil {
|
||||||
confirmation := WaitMessageAnswers[confirm.Id]
|
confirmation := WaitMessageAnswers[confirm.Id]
|
||||||
processConfirm(v, confirmation)
|
processConfirm(v, confirmation)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue