Problem/Motivation

When writing an Oauth2Client plugin you have to implement the store/retrieve/clearAccessToken methods yourself. However, it seems they will mostly be one of two common implementations (state, for all users, and tempstore, for individual users) - these are provided as examples but I think they will be commonly used it might be good to provide base class implementations or traits so developers don't have to copy and paste the methods from the examples each time.

Proposed resolution

  1. Create two traits, StateTokenStorage and TempStoreTokenStorage.
  2. Refactor the test plugins and the example plugins to use these traits.
  3. Verify passing tests.

User interface changes

None

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

fathershawn’s picture

Good idea! I think Traits is the best way forward. I created an issue fork - do you have time to contribute @longwave?

fathershawn’s picture

Assigned: Unassigned » fathershawn
fathershawn’s picture

Issue summary: View changes

fathershawn’s picture

Status: Active » Needs review

  • FatherShawn committed 71efe8d6 on 4.0.x
    Issue #3351251 by FatherShawn: Provide base classes or traits for the...
fathershawn’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.