FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Does FusionAuth support a "Remember Me" functionality?

    Scheduled Pinned Locked Moved
    Q&A
    3
    8
    2.0k
    Loading More Posts
    • 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.
    • P
      panpsonis
      last edited by

      Hi all,

      This looks like a fundamental question to me but I couldn't find any previous discussion (which probably means that I don't fully understand the topic yet).

      Does FusionAuth support a "Remember Me" functionality? What I would expect is the ability to add a "Remember Me" checkbox to the login dialog (as usual). Clicking it would allow web apps to authenticate without requiring the user to enter their credentials even after closing the browser.

      Thank you for your help.

      1 Reply Last reply Reply Quote 0
      • danD
        dan
        last edited by

        Hiya,

        Are you looking to use the login API and build your own pages, or the hosted login pages (which you can theme but FusionAuth will host)?

        Thanks,
        Dan

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • P
          panpsonis
          last edited by

          I'm primarily interested in the hosted login pages.

          However, let me know of any other setup you may have in mind so I can examine the possibility. Thank you.

          1 Reply Last reply Reply Quote 0
          • danD
            dan
            last edited by

            Hiya,

            I spent some time thinking about this. It's not built into FusionAuth (nor other oauth identity providers that I could find) and will take some coding on your end.

            I'm going to assume you are using a store between your client (the browser, a mobile app) and FusionAuth. This allows you to store the access token and the refresh token server side. It's also outlined here: https://fusionauth.io/learn/expert-advice/authentication/webapp/oauth-authorization-code-grant-sessions

            If that is the case, to achieve 'remember me', I'd do the following:

            • make sure that fusionauth and the store were in the same domain (example.com).
            • make sure you ask for the offline_access scope when presenting the login form.
            • modify the theme to add a checkbox and some javascript on the login page, which is the OAuth authorize page. More about themes. Have the javascript set a cookie (rememberme) when checked, and make sure the domain is set to something the store can read.
            • On successful authorization, have the store save off both the refreshToken and accessToken returned to it in the session.
            • When the client makes a request to the store, have it check to see if the rememberme cookie is set.
              • If not, then have the store make requests with the accessToken until it expires. When it does, force the user to login again.
              • If it is set, then have the store make requests with the accessToken until it expires. When it does, use the stored refreshToken to retrieve a new access token.

            Does that help?

            --
            FusionAuth - Auth for devs, built by devs.
            https://fusionauth.io

            1 Reply Last reply Reply Quote 0
            • P
              panpsonis
              last edited by

              Hi, thanks for the info.

              I get the idea but it's hard for me to even try to implement at the moment. I haven't done any OpenID related coding yet, plus one of my apps is a Wordpress site and I would need to dab into the OpenID plugin's code. I'm keeping the info though as I may try to go for it down the road.

              By the way, it is my understanding that Keycloak has this feature built in. I don't have any hands on experience so I can't be certain on how it works. You may want to have a look at it though in case it's something you wish to integrate in the future.
              https://wjw465150.gitbooks.io/keycloak-documentation/content/server_admin/topics/login-settings/remember-me.html

              Thanks again for your time.

              1 Reply Last reply Reply Quote 1
              • danD
                dan
                last edited by

                Hiya,

                Thanks for the feedback. I filed a feature request and we'll see what the community feedback for this idea is.

                Thanks!

                --
                FusionAuth - Auth for devs, built by devs.
                https://fusionauth.io

                1 Reply Last reply Reply Quote 0
                • robotdanR
                  robotdan
                  last edited by

                  Is this a different use case than SSO, and if so, what are the limitations of SSO as it is currently implemented that don't fit this use case?

                  1 Reply Last reply Reply Quote 0
                  • danD
                    dan
                    last edited by

                    You can also view some of the back and forth between @robotdan and I on the issue I filed: https://github.com/FusionAuth/fusionauth-issues/issues/878 🙂

                    --
                    FusionAuth - Auth for devs, built by devs.
                    https://fusionauth.io

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post