Skip to content

Token Expire Time Management #1

Open

Description

@yxdy1990

Do you have any idea for the managment of token expire?

Activity

  1. bootsrc commented on Feb 23, 2019

    @bootsrc
    Owner

    Do you have any idea for the managment of token expire?
    Reply
    This is a good question! I want to add expireTome (expireDelta = Delta) to the project, but I don't have time to do it yet.
    This is my solution.

    Persist expireDelta = Delta (expire interval value) to the database. And write it in redis at the same time.
    When the user invokes the web API, if the permission authentication passes, set updated 'endTime' to redis( Now endTime = oldEndTime + Delta )

    If the user is calling the web API frequently and at intervals < Delta., it can access the API normally all the time without being blocked to the login window. If curentTime < endTime, let the request go ahead.

    Just like QQ login. If you log in every day, you can log in automatically. If you don't log in for 2 months, you need to re-enter your password to log in.

    Thank you for your support!

  2. yxdy1990 commented on Feb 23, 2019

    @yxdy1990
    Author

    Quick response ! Got it.
    But I think that It's better to have one API to do the "refresh" action. Instead of updating endTime in every API request. This is my humble opinion.

    Thanks !

  3. bootsrc commented on Feb 23, 2019

    @bootsrc
    Owner

    Yes, this is one option

  4. pinned this issue on Mar 2, 2019
  5. reopened this on Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions