yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Enhancement suggestion for using with RESTFul Architecture

Open kartik-v opened this issue 6 years ago • 2 comments

Just a suggestion to see if we can enhance the module for usage with RESTFul API architecture.

The authentication needs to follow these Yii2 RESTFul best practices

Some views:

  • Based on a module configuration property - RESTFul architecture can be enabled
  • For TOKEN based AUTH the user table can be linked to a new auth table to store access_token / refresh_token for each user
  • User model can then implement findIdentityByAccessToken, methods to create access_token and refresh_token and other suggestions as in Yii2 guide
  • Leave options to the developer for advanced OAuth based auths

kartik-v avatar Sep 16 '19 05:09 kartik-v

Thanks @kartik-v for bringing the discussion about it, but first would require to split the components (as of https://github.com/2amigos/yii2-usuario/tree/usuario-2.0-dev I am trying to do), then think how this enhancement should be added.

That is something it hit my mind many times. Thanks for bringing the subject.

tonydspaniard avatar Sep 17 '19 15:09 tonydspaniard

any updates on this? Any tutorial or documentation to do this? Thanks

srakl avatar Jun 21 '21 08:06 srakl