Provide an HTTP anthentification over XMPP (XEP-0070).
Go to file
Chteufleur 02202b94d5 Make some config with default value 2016-06-21 21:03:32 +02:00
http Replace HTTP Forbidden by HTTP Unauthorized 2016-06-20 20:49:09 +02:00
xmpp Add HTTP port to config file 2016-06-20 19:20:13 +02:00
.gitignore initial commit 2016-05-18 10:16:14 +02:00
LICENSE Modification License file 2016-06-20 22:12:35 +02:00
README.md Write the right URL into readme for go get 2016-06-21 14:34:58 +02:00
httpAuth.cfg Make some config with default value 2016-06-21 21:03:32 +02:00
main.go Make some config with default value 2016-06-21 21:03:32 +02:00

README.md

HTTPAuthentificationOverXMPP

Provide an HTTP anthentification over XMPP. Implementation of XEP-0070.

Compilation

Dependencies

  • go-xmpp for the XMPP part.
  • cfg for the configuration file.

Download the CA at https://kingpenguin.tk/ressources/cacert.pem, then install it on your operating system. Once installed, go into your $GOPATH directory and go get the source code.

go get git.kingpenguin.tk/chteufleur/HTTPAuthentificationOverXMPP.git

Configure

Configure the gateway by editing the httpAuth.cfg file in order to give all XMPP component and HTTP server informations.

Utilization

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)
  • domain: Domain you want to access
  • method: Method you access the domain
  • transaction_id: Transaction identifier

Example:

GET /auth?jid=user@host/resource&domain=example.org&method=POST&transaction_id=WhatEverYouWant HTTP/1.1

This will send a request to the given JID. If the user accept, the server will return HTTP code 200, otherwise it will return HTTP code 401.