Skip to content

Record auth_time in authorization codes and carry it through to access and refresh tokens #362

Open

Description

@dshanske

Store the time the user actually logged in (auth_time) with each authorization code. Then carry it, unchanged, into the access token and every refresh token that comes from that code. This is a small change to the core plugin with no OIDC dependency. It makes introspection more useful.

auth_time is the Unix timestamp (in seconds) of the user's last active authentication.

It has to be captured at the authorization step, because that's the only point where the WordPress session cookie is available. WordPress already records this: WP_Session_Tokens::create() stores $session['login'] = time() for every session.

This would have to be amended in the Authorization Controller, the Fedcm Controller and the Token Controller.

A resource server such as a Micropub endpoint can check auth_time through introspection and refuse sensitive actions when the login is old, responding with insufficient_user_authentication and a max_age.

It can also be shown on the token management screen, and appropriate age settings added to require reauthentication if needed for certain tokens.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions