Results 1 to 5 of 5

Thread: How to save credentials in local keychain

  1. #1
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to save credentials in local keychain

    Hi,

    In my application the user may need to provide username and password to access some remote machines... I would like to allow the user to load/restore those credentials.

    For example in Mac machines I can see some application save/load passwords in/from local keychain. Does Qt provides any generic way to do it?

    Thanks in advance for you hints.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to save credentials in local keychain

    You can store persistant data using QSettings.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to save credentials in local keychain

    QSettings allows to store generic data... What if I want to save passwords?
    In theory I need to encrypt them before saving, I also need to provide a encryption key and so on.

    On Mac all passwords are saved in the keychain the user can access providing his system password. I have seen something similar in some Linux distribution too.
    I was wondering whether Qt provides a generic way to do that, platform independent.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to save credentials in local keychain

    Quote Originally Posted by kalos80 View Post
    QSettings allows to store generic data... What if I want to save passwords?
    In theory I need to encrypt them before saving, I also need to provide a encryption key and so on.
    So encrypt it and store it in QSettings.

    On Mac all passwords are saved in the keychain the user can access providing his system password. I have seen something similar in some Linux distribution too.
    You can easily attach to those keychains using native API.
    I was wondering whether Qt provides a generic way to do that, platform independent.
    No, there are too many solutions to handle them all. For instance on Linux you might be using KDE or GNOME or neither and (probably) each has own wallet implementation. You might want to take a look at PolicyKit though, there is probably a PolicyKit interface available for different password storage mechanisms on Unix. It might be simpler to store passwords using QSettings or [wiki=Building_QSQLITE_driver_with_AES-256_encryption_support]encrypted local SQLite database[/wiki] though
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to save credentials in local keychain

    wysota,
    thank you very much for your advices, they are very useful

Similar Threads

  1. How to close a local QDialog?
    By MorrisLiang in forum Newbie
    Replies: 2
    Last Post: 23rd August 2010, 10:19
  2. Local Status Bar Does Not Update
    By shawno in forum Qt Programming
    Replies: 0
    Last Post: 16th July 2010, 01:34
  3. item local coordinate
    By dreamer in forum Qt Programming
    Replies: 6
    Last Post: 11th May 2008, 22:49
  4. How to get and set local ip in windows xp using QT?
    By longtrue in forum Qt Programming
    Replies: 0
    Last Post: 5th May 2008, 08:55
  5. How to get local IP
    By naresh in forum Qt Programming
    Replies: 11
    Last Post: 17th May 2006, 15:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.