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

    getting user object when getting new access token with refresh token

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 1.3k Views
    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.
    • N
      nicholas.tsaoucis
      last edited by

      we currently save the jwt returned after logging in between sessions and use it to allow the user to automatically log back in on its own.
      We use the POST /api/jwt/refresh to get a new access token when a user refreshes their page or has opted to "remember me" and allow the app to automatically log in on its own (as long as the saved jwt is valid)
      The issue we are runing into though, is the login api provides the user object also, where as the refresh jwt does not.

      i Imagine i could just ofc call the retrieve/user api but i wanted to find out if im doing the wrong thing to start with and there is a better way to do what im trying to do (like something as simple as "login with jwt" or something like that)

      danD 1 Reply Last reply
      Reply Quote 0
      • danD
        dan @nicholas.tsaoucis
        last edited by

        @nicholas-tsaoucis

        You could either store off the user object on first login (into a session or something similar) or call 'retrieve user' using the user API and presenting a JWT.

        https://fusionauth.io/docs/v1/tech/apis/users#retrieve-a-user

        I don't think you're doing anything wrong by doing so.

        --
        FusionAuth - Identity Without Constraints
        https://fusionauth.io

        1 Reply Last reply
        Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post