Re: Is there a way to get nm-applet to prompt for network security credentials through dbus?



On Wed, 2010-02-24 at 11:10 -0800, Greg Suarez wrote:
> 
> 
> On Wed, Feb 24, 2010 at 4:25 AM, Marc Herbert <Marc Herbert gmail com>
> wrote:
>         Greg Suarez a écrit :
>         > I'm trying to get NetworkManager to connect to a wireless AP
>         through the
>         > d-bus interface.  The AP requires security credentials (i.e.
>         WPA
>         > password), is there a way I
>         > can communicate to the nm-applet to prompt the user for the
>         > information?
>         
>         
>         I am not 100% sure what you want here but any time you start
>         GNOME's
>         nm-connection-editor it will prompt the user to configure
>         anything,
>         including wireless credentials.
>         
>         > So all I have to do is tell the nm-applet to get the
>         > credentials which will create a connection and I can tell
>         NetworkManager
>         > to use the connection provided by the nm-applet.
>         
>         
>         I think yes.
>         
>         If this wireless connection is the only one configured and
>         available
>         then you do not even need to direct NM to it; it should
>         automatically
>         fallback to the only one available.
>         
>         
>         > Or am I stuck having to write my own app?
>         
>         
>         Which would do what?
>         
> 
> Sorry, I should've explained that I'm writing an application and I'm
> interfacing with NetworkManager through dbus.
> I want my application to get the list of wireless networks from
> NetworkManager and allow the user to select it and
> then tell NetworkManager to connect to the network.  What I was hoping
> I could do was to somehow tell nm-applet, 
> from my application, to prompt the user for security credentials.
> Then I can tell NetworkManager to use the new connection.

NetworkManager operates on "Connections", which are a collection of all
the settings required to connect to a specific network (for wifi, that's
SSID, security settings, etc).  That's provided to NetworkManager by one
of the two "settings services" either nm-applet (user-specific settings)
or NM itself (system-wide settings).

So first you need a Connection defined for that network.  Once nm-applet
knows about a connection for the network, any application (not just
nm-applet) can tell NM to switch networks.  nm-applet will then ask for
the password if one doesn't exist.

I suspect that you simply don't have a connection set up for that
network yet?  nm-applet does that automatically the first time you click
on a wifi network from its menu, otherwise sysadmins can preload
connections via gconftool-2, which the applet uses as the configuration
storage system.

Dan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]