Skip to content

Move token (a) caching and (b) refresh token layer from req_oauth_*() to oauth_flow*() #328

@fh-mthomson

Description

@fh-mthomson

Goal: use oauth_flow_auth_code() as a single function through which I can:

  1. Generate: Create a token
  2. Cache: Initialize/leverage a cache using ^ token (via cache_choose() et al)
  3. Refresh: If a given token (new or cached) is expired, use the refresh token to generate a new token (rather than oauth_flow_refresh(), as discussed at length in Rotating refresh tokens #186)

Currently, only (1) is supported by oauth_flow_auth_code() whereas (2) & (3) are automated via auth_outh_sign() but only as an indirect side effect of calling req_oauth_auth_code().

Proposal: move the auth_outh_sign() logic to the token-generation layer, instead of (or in addition to) the request layer, since, e.g., req_oauth_auth_code() calls oauth_flow_auth_code() anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions