Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Secure way of connecting to database
Qt 6.11 is out! See what's new in the release blog

Secure way of connecting to database

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 597 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thombou
    wrote on last edited by
    #1

    Hello,
    I have problems to understand how to connect securely to a database. My software is a client that connects to a remote server on which the database is installed.
    For now I was planning connect directly to the database using QtSql object, and using SSL and certificates. However, I don't understand how someone who have access to the executable could not retrieve those certificates and access the database.
    Another option would be to create an API on the server side, between the client and the database, but then what is the use of the QtSql classes?

    If you think I should go for an API implementation, would you have any recommendations of how to implement it (tutorials, framework, etc) ?

    Thanks
    Thombou

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi,

      Since you are used to PHP, try the slim framework.

      In any case, what languages are you most fluent with ?

      [edit] my bad, I may have mixed this with another thread.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      T 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Since you are used to PHP, try the slim framework.

        In any case, what languages are you most fluent with ?

        [edit] my bad, I may have mixed this with another thread.

        T Offline
        T Offline
        Thombou
        wrote on last edited by
        #3

        @SGaist
        So first, you think the API is the best way to go?
        Otherwise I am indeed used to php (nice guess!) or python
        Thanks :)
        Thombou

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          For python, depending on your needs, the Django REST framework is pretty good.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Thombou
            wrote on last edited by
            #5

            Thanks @SGaist !
            Before I start diving into Django (I never used it), I have a few questions. I have heard of Flask also, which apparently is easier to use that Django. What do you think would be the best?
            In my client I will ask for username and password for the user, then the API has to check is hose credentials are valid and return a token to the client. Then each time a the client has to interact with the database, the token has to be provided to be sure that the user is authorized to have access to the data. Is that the way I should implement my interactions with the database?

            In that case, which framework would be the best?

            Thanks!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Flask is also good. It is a bit lower level than Django. I would say that you should compare the frameworks for user management that operate with Flask to see what would be easier for you to maintain in the long run.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved