Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to make session system in mobile application

How to make session system in mobile application

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
9 Posts 5 Posters 1.6k Views
  • 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.
  • M Offline
    M Offline
    maydin
    wrote on last edited by
    #1

    In frameworks like Flask or NodeJS, there are session modules that help us implementing login system. But those applications run through internet browsers generally.

    I want to make a mobile application with login system. I can write online API with Flask or NodeJS but I dont know how I handle phone application.

    I will make a login dialog but what should happen after user enters their credetials. I will send username and password to API but what should return and what i should do with that.

    jsulmJ 1 Reply Last reply
    0
    • M maydin

      In frameworks like Flask or NodeJS, there are session modules that help us implementing login system. But those applications run through internet browsers generally.

      I want to make a mobile application with login system. I can write online API with Flask or NodeJS but I dont know how I handle phone application.

      I will make a login dialog but what should happen after user enters their credetials. I will send username and password to API but what should return and what i should do with that.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @maydin Where do you want to log in? In your app on the phone or on some server?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • 6thC6 Offline
        6thC6 Offline
        6thC
        wrote on last edited by
        #3

        What you've mentioned are more frameworks and not a specific authentication protocol or anything like that... not sure the real answer you want cause I can't really make out a clear question. However, here's my response, I hope it helps:

        Authenticating with a server shouldn't matter mobile or app really - assuming they are a network packet with data / web requests to a server right?

        There's network authentication docu at: https://doc.qt.io/qt-5.11/qtnetworkauth-index.html

        There are also example apps (which are often a great way to fill in any gaps) at: http://doc.qt.io/qt-5/examples-network.html

        1 Reply Last reply
        0
        • jsulmJ jsulm

          @maydin Where do you want to log in? In your app on the phone or on some server?

          M Offline
          M Offline
          maydin
          wrote on last edited by
          #4

          @jsulm I want to make an application like Twitter or Facebook. In those applications, after logging in you will see your feed etc. But if you change your password from different place, it automatically logs out from mobile app.

          @6thC I already checked those examples and modules. OAuth is different thing probably according to my research. If my app wants to use some data from Facebook, it should connect to OAuth system of Facebook. But I dont want to connect external APIs like Facebook or Twitter.

          Let me give me an example:

          • User opens app and sees login dialog.
          • User enters their name and password.
          • Then app shows user's feed, events etc.
          • Everytime user open app again, it automatically logs on (in web browsers, cookies helps for this)
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            You should check the Cutelyst project which might simplify your application/web backend development.

            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
            • M Offline
              M Offline
              maydin
              wrote on last edited by
              #6

              I think I cannot explain what I want.

              I know how to write programs in Qt and i can write web server by using NodeJS.

              I just want to make a "login" system. User will enter his name and password and he will see the things in program.

              I will send username and password to my webserver and what will happen. This is problem. What should i do next?

              kshegunovK 1 Reply Last reply
              0
              • M maydin

                I think I cannot explain what I want.

                I know how to write programs in Qt and i can write web server by using NodeJS.

                I just want to make a "login" system. User will enter his name and password and he will see the things in program.

                I will send username and password to my webserver and what will happen. This is problem. What should i do next?

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by
                #7

                @maydin said in How to make session system in mobile application:

                What should i do next?

                Well the server should return you something - a login success/failed with optionally a status message, maybe also some kind of credentials tree/list. You can just store the response data in your own class and continue on from there. Whenever you have something that requires a logged user, you check if they've logged in and if they have access to that feature ... pretty much the same thing you do with web development.

                If your auth scheme (which is not clear from the question) is more complicated, it may be needed to exchange tokens between the client and the server at key points, however this really depends on how you mean to implement the application.

                Read and abide by the Qt Code of Conduct

                M 1 Reply Last reply
                2
                • kshegunovK kshegunov

                  @maydin said in How to make session system in mobile application:

                  What should i do next?

                  Well the server should return you something - a login success/failed with optionally a status message, maybe also some kind of credentials tree/list. You can just store the response data in your own class and continue on from there. Whenever you have something that requires a logged user, you check if they've logged in and if they have access to that feature ... pretty much the same thing you do with web development.

                  If your auth scheme (which is not clear from the question) is more complicated, it may be needed to exchange tokens between the client and the server at key points, however this really depends on how you mean to implement the application.

                  M Offline
                  M Offline
                  maydin
                  wrote on last edited by
                  #8

                  @kshegunov Yes, you told what I want to hear.

                  It seems I have to store username and password in my application and send to server anytime I want to request something along with data. An example request should look like this:

                  {
                    id: 1 ,
                    credentials: {
                      username: user123
                      password: pass123
                    },
                    request: "showFeed"
                  }
                  

                  If your auth scheme (which is not clear from the question) is more complicated, it may be needed to exchange tokens between the client and the server at key points, however this really depends on how you mean to implement the application.

                  Webserver frameworks like Flask and NodeJS provide modules for auth. Probably I should learn those modules' token system and design app according to that.

                  If you have any advice for designing app with auth system (also for webserver), I would like to hear.

                  kshegunovK 1 Reply Last reply
                  0
                  • M maydin

                    @kshegunov Yes, you told what I want to hear.

                    It seems I have to store username and password in my application and send to server anytime I want to request something along with data. An example request should look like this:

                    {
                      id: 1 ,
                      credentials: {
                        username: user123
                        password: pass123
                      },
                      request: "showFeed"
                    }
                    

                    If your auth scheme (which is not clear from the question) is more complicated, it may be needed to exchange tokens between the client and the server at key points, however this really depends on how you mean to implement the application.

                    Webserver frameworks like Flask and NodeJS provide modules for auth. Probably I should learn those modules' token system and design app according to that.

                    If you have any advice for designing app with auth system (also for webserver), I would like to hear.

                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #9

                    @maydin said in How to make session system in mobile application:

                    Probably I should learn those modules' token system and design app according to that.

                    Indeed, perhaps is a good idea to at least glance at them and try to see what the idea is, then decide what to do with your app.

                    If you have any advice for designing app with auth system (also for webserver), I would like to hear.

                    Not really, this is very specific to the way the app is going to work and what you mean by auth, whether it includes only users and passwords, does it have user roles and/or specific permissions for specific actions; whether the permissions are "flat" or form a tree of choices and so on.

                    Read and abide by the 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