GithubHelp home page GithubHelp logo

ewindso / http_prebind Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skeltoac/http_prebind

2.0 3.0 1.0 70 KB

Ejabberd web module to create HTTP BIND sessions with a single HTTP GET. Useful for Strophe::attach().

http_prebind's Introduction

Usefulness:
This is a sloppy hack to speed up BOSH session initiation for logged-in users. The web server makes a single GET request to start the session and passes the JID, SID, and RID in the HTML for Strophe::attach(). I created http_prebind because a) user passwords are not known because they are stored hashed, and b) the BOSH handshake is too complex. This module allows a predefined system user to create sessions for other users without knowing their passwords. It speeds up the process of getting the authenticated user connected over BOSH. It could be more secure and easier to set up and use but I stopped working on it when it met my needs. I will be happy to see it forked and improved or made obsolete.


Installation:
Customize your auth module so it accepts a backdoor password.
Edit http_prebind and replace these:
{"systemuser", "example.com"}
 - The request from the web server will use Basic Authentication to authenticate as this user. Any other user is unauthorized to use http_prebind.
backdoor_password
 - The auth module must accept this password for any user that you wish to be able to use http_prebind.
example.com
 - Your service host.

Compile. Copy beam file to /lib/ejabberd/ebin or whatever.

Add this to your ejabberd.cfg in the http_fileserver section:
	 {["http-prebind"], http_prebind},

Reload the configuration from the debug console:
ejabberd_config:load_file("/etc/ejabberd/ejabberd.cfg").


Sample HTTP request: (username is andy)
GET /http-prebind/andy HTTP/1.0
Host: im.wordpress.com
Authorization: Basic my_precomputed_systemuser_auth


Sample HTTP response: (the body is JID\nSID\nRID)
HTTP/1.0 201 Created
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 99

[email protected]/19470701321248704284877554
938f2ae10569c24367c0822e76e42dd5cd026f71
461602958

http_prebind's People

Contributors

skeltoac avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

munaxweb2011

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.