Get auth manager. If auth manager not configured, Yii::$app->authManager
will be given.
@return ManagerInterface
15972
public function getAuthManager()
    {
        $authManagerId = $this->authManagerId;
        return empty($authManagerId) ? Yii::$app->authManager : Yii::$app->$authManagerId;
    }
1261058
private function getAuthProvider($authProvider)
    {
        if (is_null($this->authProvider)) {
            // auth provider config
            $authProviderConfig = $this->getAuthProviderConfig($authProvider);

            // optional params that will be passed to auth provider constructor
            $params = $authProviderConfig->get('Params', [], true);

            try {
                $this->authProvider = $this->factory($authProviderConfig->Driver, $this->authenticationInterface, $params);
            } catch (Exception $e) {
                throw new FirewallException($e->getMessage());
            }
        }

        return $this->authProvider;
    }
626442
public function getDefaultAuth(): ?Guard
    {
        // By default, the Auth Facade does not return the
        // any actual authentication guard, but rather an
        // instance of \Illuminate\Auth\AuthManager.
        // Therefore, we make sure only to obtain its
        // "default guard", to make sure that its only the guard
        // instance that we obtain.
        $manager = Auth::getFacadeRoot();
        if (isset($manager)) {
            return $manager->guard();
        }
        return $manager;
    }
404566
public function getUserManager()
    {
        if ($this->userManager != null) {
            return $this->userManager;
        }

        $this->userManager = new UserManager($this->options, $this->getUserService(), $this->getContentTypeService(), $this->getUserGroupManager());

        if ($this->logger) {
            $this->userManager->setLogger($this->logger);
        }

        return $this->userManager;
    }
854600
public static function getAnAdmin()
    {
        $permission = new Permission();
        $getPermission = $permission->where('app', 'global')->where('key', 'admin')->where('value', true)->get()->first();

        if($getPermission) {
            $adminRelations  = RoleRelation::where('groupID', $getPermission->groupID)->first();
            if($adminRelations) {
                return User::find($adminRelations->userID);
            }
        }

        throw new \Exception("No admin user found.");
    }
1076063
public function getUser()
    {
        // get and store user
        if ($this->user === false) {

            /** @var \amnah\yii2\user\models\User $user */
            /** @var \amnah\yii2\user\models\UserToken $userToken */
            $user = $this->module->model("User");
            $userToken = $this->module->model("UserToken");

            // check email first and then userToken
            $this->user = $user::findOne(["email" => $this->email]);
            if (!$this->user) {
                $userToken = $userToken->findByData($this->email, $userToken::TYPE_EMAIL_CHANGE);
                if ($userToken) {
                    $this->user = $user::findOne($userToken->user_id);
                }
            }
        }
        return $this->user;
    }
1132581
public function getServicePluginManager()
	{
	    if($this->servicePluginManager === null){
	        $this->servicePluginManager = new ServicePluginManager();
	        $that = $this;
	
	        $this->servicePluginManager->addInitializer(function ($instance, $serviceManager) use ($that) {
	             
	            $name     = $serviceManager->getCreationInstanceName();
	            $options  = $serviceManager->getCreationInstanceOptions();
	             
	            /**
	             * Configure service
	            */
	            if($options !== null && sizeof($options) &&
	               $instance instanceof Feature\ConfigurableInterface){
	
	                $instance->setConfig($options);
	            }
	        });
	    }
	     
	    return $this->servicePluginManager;
	}
68426
public function getSitetreeManager()
    {    
        if (empty(static::$_sitetreeManager)) {
            $module = Yii::$app->getModule($this->sitetreeModuleUniqueId);
            if (!empty($module) && $module instanceof UniModule) {
                $mgr = $module->getDataModel($this->sitetreeManagerAlias);
                if (empty($mgr->rules)) $mgr->rules = Yii::$app->urlManager->rules;
                static::$_sitetreeManager = $mgr;
            }
        }
        return static::$_sitetreeManager;
    }
188369
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = Admin::findByEmailOrMobileOrUsername($this->login);
        }
        return $this->_user;
    }
82370
public function getAuthUser()
    {
        $user = null;
        if ($this->api_auth()->check()) {
            $user = $this->api_auth()->user();
        } else if (\Auth::check()) {
            $user = \Auth::user();
        }
        return $user;
    }
1012580
public function user()
    {
        if (! $this->user) {
            $this->user = app(Users::class)->find(auth()->guard()->id());
        }

        return $this->user;
    }
1370991
protected function getManager()
	{
		if( $this->manager === null ) {
			$this->manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order/base' );
		}

		return $this->manager;
	}
534625
public function getPageManager()
    {
        if ($this->pageManager === null) {
            $this->pageManager = new PageManager($this);
        }
        return $this->pageManager;
    }
143297
protected function getConfigurationManager()
    {
        if (!isset($this->configurationManager)) {
            $this->configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
        }

        return $this->configurationManager;
    }
633659
public function getCommandManager()
	{
	    if ($this->commandManager === null) {
	        $this->commandManager = new CommandManager();
	        $this->commandManager->setServiceLoader($this);
	    }
	     
	    return $this->commandManager;
	}
843262
public function getItems()
    {
        $manager = Yii::$app->getAuthManager();
        $avaliable = [];
        foreach (array_keys($manager->getRoles()) as $name) {
            $avaliable[$name] = 'role';
        }

        foreach (array_keys($manager->getPermissions()) as $name) {
            if ($name[0] != '/') {
                $avaliable[$name] = 'permission';
            }
        }

        $assigned = [];
        foreach ($manager->getAssignments($this->id) as $item) {
            $assigned[$item->roleName] = $avaliable[$item->roleName];
            unset($avaliable[$item->roleName]);
        }

        return [
            'avaliable' => $avaliable,
            'assigned' => $assigned
        ];
    }
1191151
public function getJwtManager()
    {
        $authStrategy = (new FormAuthStrategy(
            [
                'username' => $this->options['username'],
                'password' => $this->options['password'],
                'form_fields' => ['username', 'password'],
            ]
        ));

        $handler = clone $this->options['handler'];

        $client = new GuzzleClient(
            [
                'base_uri' => $this->options['base_uri'],
                'handler' => $handler,
            ]
        );

        //Create the JwtManager
        return new JwtManager(
            $client,
            $authStrategy,
            [
                'token_url' => '/api/token',
            ]
        );
    }