I tried to implement CAS Authentication on Yii 2, but it seems I can’t do it with the IdentityInterface.
Maybe I didn’t understand well, but it seems that in order to manipulate the User class correctly, you have to implement the IdentityInterface.
However, you have to implement for exemple the method findIdentity($id).
With a CAS authentication, I have no means to get information by passing the $id argument.
Indeed, when you want to authenticate, you are redirected to a CAS page, and there you pass the login and password, and the CAS server decides if you are authenticated or not.
So, I can’t find nor provide Identity for a given $id.
How is it possible to make a CAS authentication with Yii 2, by using the User possibilities? (I want to use the Autorization features with the RBAC for example, I need the User feature.)
Then use the phpCAS functions to authenticate. I configured my CAS information in config/params, then replaced the SiteController->actionLogin function with: