Belligero

Because I can...

 
  • Increase font size
  • Default font size
  • Decrease font size

NetworkManager Web Authentication: 0.1 Release

E-mail Print PDF

This is my official 0.1 release for the NetworkManager Web Authentication program I have been working on. This is a much more formal release than the one I did last night, and as such, will have a lot more information.  If you do not know anything about this, there is a page on this wiki detailing the specifics of the idea.

What this release is, at present:

  • Firefox Extension
  • Linux-only
  • C++ XPCOM object to communicate with DBus
  • Communication between the extension and another running program via DBus
  • A few prompts and dialog boxes as a proof of concept

A basic how-to to use this extension:

  1. Download and extract the tarball
  2. Install the correct Firefox extension (x86 or x86_64) as they are not cross-platform
  3.  Start Firefox.  You will be presented with a series of prompts
  4. Run the dbus executable from the tarball in a terminal as follows:
    1. To receive a signal: ./dbus receive
    2. To send a signal: ./dbus send "message"
  5. Try sending various pieces of information back and forth
  6. When done, disable or uninstall the extension to make sure you don't get the prompts every time it starts

More information on this follows...

 

If you look in the files, you will notice that there is nmautologin-0.1-ext-src.tar.gz and nmautologin-0.1-src.tar.gz .  This is not a mistake, but somehting I had to do as a workaround for a problem I detailed in this posting.  If you want to compile it yourself, do this:

 

  1. Extract the contents of the  nmautologin-0.1-src.tar.gz and move the nmautologin directory to srcdir/extensions/ in a Mozilla source tree
  2. Edit your .mozconfig file, and make sure you have ac_add_options --enable-extensions=default,nmautologin in it.  This tells make to compile the code
  3. Extract the contents of nmautologin-0.1-ext-src.tar.gz somewhere
  4. Go into the newly created direcotry, objdir/dist/bin/extensions/ This e-mail address is being protected from spambots. You need JavaScript enabled to view it /components and copy the files into the components/ directory of the extension source (these are the files needed for the binary side of the XPCOM)
  5. In Firefox, use Ted's Extension Developer's Extension and do:
    1. Tools -> Extension Developer -> Extension Builder
    2. Click Browse and go to where you put the extension source
    3. Click "Build Extension"
  6. Step 5 will produce a file, autologin.xpi, in the extension's source directory, install this into Firefox
  7. Make sure you have compiled the second program from dbus-example.c
    1. cd to the directory the file is in
    2. gcc -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -L/lib -ldbus-1dbus-example.c -o dbus
  8. Test both side by running Firefox, and thedbus program as explained earlier

The dbus-example.c is modified from from the one given in Freedesktop.org's DBus C API tutorial to work with the naming schemes I'm using in the extension.  Other then path/interface/signal name changes, this file is as how it was downloaded.

With this working as it is, there are a few things I want to change before 0.2:

  • Double-check that my memory management is proper
  • Make the dbusClient constructor accept arguments for DBus interface and object paths, to make it better for others to use
  • Along with the above, change extension settings for the XPCOM side to let it be compiled without the name "nmautologin" alowing for the components to be used without the other half
  • get the XPCOM to work on all systems (that part of te article simply has "TODO" there)

And, my plans for the 0.2 release:

  • Submit a bug report for NetworkManager about the automatic web authentication
  • Start hacking the NM code to allow signals to be sent to the extension for various events
  • Get the extension to be more like an event listener for the signals being sent
I think just between hacking the NM code and forcing it to be an event listener should be a challenge in and of itself, especially with other courses picking up in workload
 

Add your comment

Your name:
Your email:
Your website:
Subject:
Comment:

User Login