pgaultier / yii2-oauth2

OAuth2 wrapper for Yii2 applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get all client from redis?

dixonsatit opened this issue · comments

hi @pgaultier.
I want to get all client by user from redis?

Hi, right now the feature does not exist but we are working on it.
For example, we already added in devel methods to find all tokens (refresh and access) for specific user.

  • AccessToken::findAllByUserId()
  • AccessToken::findAllByClientId()
  • RefreshToken::findAllByUserId()
  • RefreshToken::findAllByClientId()

which will allow you to revoke tokens on demand.

Thank you. @pgaultier 👍

Hello,

We finally updated the code to let you perform queries :

  • Client::findAllByUserId()
  • $client->addUser()
  • $client->hasUser()
  • $client->removeUser()

Everything has been pushed on devel branch. Please tell me if it's not working.

Regards

BTW, additional methods have been created

  • AccessToken::deleteAllByUserId()
  • AccessToken::deleteAllByClientId()
  • RefreshToken::deleteAllByUserId()
  • RefreshToken::deleteAllByClientId()

We also added automatic expiration of AccessTokens, RefreshTokens and AuthorizationCodes to not fill the database with useless data

Any news ? Can I close the issue ?