common/models/entities/User.php
public static function findIdentityByAccessToken( $token, $type = null ) {

		// TODO: Also check access token validity using apiValidDays config

		if( Yii::$app->core->isApis() ) {

			// Find valid User
			$user	= static::findByAccessToken( $token );

			// Load User Permissions
			if( isset( $user ) ) {

				if( Yii::$app->core->isRbac() ) {

					$user->loadPermissions();
				}

				return $user;
			}

			throw new NotFoundHttpException( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
		}

		throw new NotSupportedException( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_APIS_DISABLED ) );
	}
public static function findIdentityByAccessToken( $token, $type = null ) {

		// TODO: Also check access token validity using apiValidDays config

		if( Yii::$app->core->isApis() ) {

			// Find valid User
			$user	= static::findByAccessToken( $token );

			// Load User Permissions
			if( isset( $user ) ) {

				if( Yii::$app->core->isRbac() ) {

					$user->loadPermissions();
				}

				return $user;
			}

			throw new NotFoundHttpException( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
		}

		throw new NotSupportedException( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_APIS_DISABLED ) );
	}
public static function findIdentityByAccessToken ( $ token , $ type = null ) { // TODO: Also check access token validity using apiValidDays config if ( Yii :: $ app -> core -> isApis ( ) ) { // Find valid User $ user = static :: findByAccessToken ( $ token ) ; // Load User Permissions if ( isset ( $ user ) ) { if ( Yii :: $ app -> core -> isRbac ( ) ) { $ user -> loadPermissions ( ) ; } return $ user ; } throw new NotFoundHttpException ( Yii :: $ app -> coreMessage -> getMessage ( CoreGlobal :: ERROR_NOT_FOUND ) ) ; } throw new NotSupportedException ( Yii :: $ app -> coreMessage -> getMessage ( CoreGlobal :: ERROR_APIS_DISABLED ) ) ; }
Finds user identity using the given access token and also loads the available
permissions if RBAC is enabled for the application.

@param string $token
@param string $type
@throws \yii\web\NotFoundHttpException
@throws \yii\base\NotSupportedException
@return a valid user based on given token and type
Finds user identity using the given access token and also loads the available permissions if RBAC is enabled for the application .