In Yii2 you can access the identity interface for the current user by using the identityInterface object from within the \\yii\\web\\User class with something like this
The best way to add attributes to user is creating public attribute in your User Class.
class Yiidentity extends ActiveRecord implements \yii\web\IdentityInterface{ public $awesomeAttribute = "foo"; }
How to use:
Yii::$app->user->identity->awesomeAttribute;