@param $name
@param AuthStrategy $strategy

@return $this
@throws StrategyAlreadyRegisteredException
503016
public function register($name, AuthStrategy $strategy)
    {
        if($this->getOrNull($name)) {
            throw new StrategyAlreadyRegisteredException;
        };

        $this->strategies[$name] = $strategy;

        return $this;
    }
769495
public Object getDynamicStrategy(Package packageVO, Class<? extends RegisteredService> strategyInterface, String strategyClassName) {
        return super.getDynamicService(packageVO, strategyInterface, strategyClassName);
    }
1127919
public AuthSource findByStrategy(String strategy) {
    EntityManager entityManager = getEntityManager();
    
    CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
    CriteriaQuery<AuthSource> criteria = criteriaBuilder.createQuery(AuthSource.class);
    Root<AuthSource> root = criteria.from(AuthSource.class);
    criteria.select(root);
    criteria.where(
      criteriaBuilder.equal(root.get(AuthSource_.strategy), strategy)
    );

    return getSingleResult(entityManager.createQuery(criteria)); 
  }
436125
public function make($strategy, array $options = [])
    {
        $instance = $this->instantiateClass(
            $this->resolveStrategyClassName($strategy)
        );

        if ( ! ($instance instanceof VariantStrategyInterface)) {
            throw new RuntimeException("Variant strategy created for '{$strategy}' is of incorrect type");
        }

        return $instance->setOptions($options);
    }
1091331
private function _addExclusionStrategy(ExclusionStrategyInterface $strategy): void
    {
        if (null === $this->exclusionStrategy) {
            $this->exclusionStrategy = $strategy;

            return;
        }

        if ($this->exclusionStrategy instanceof DisjunctExclusionStrategy) {
            $this->exclusionStrategy->addStrategy($strategy);

            return;
        }

        $this->exclusionStrategy = new DisjunctExclusionStrategy([
            $this->exclusionStrategy,
            $strategy,
        ]);
    }
5058
public function setClause(string $name, ClauseStrategy $query)
    {
        $this->clauses[$name] = $query;

        return $this;
    }
1201856
protected function resolveReferenceStrategyClass($strategy)
    {
        if ( ! empty($strategy)) {

            if ( ! str_contains($strategy, '.')) {
                $strategy = config('cms-models.strategies.reference.aliases.' . $strategy, $strategy);
            }

            if (class_exists($strategy) && is_a($strategy, ReferenceStrategyInterface::class, true)) {
                return $strategy;
            }

            $strategy = $this->prefixReferenceStrategyNamespace($strategy);

            if (class_exists($strategy) && is_a($strategy, ReferenceStrategyInterface::class, true)) {
                return $strategy;
            }
        }

        return false;
    }
808056
protected function getPasswordHashingStrategyAndIdentifier($strategyIdentifier = 'default')
    {
        if (isset($this->passwordHashingStrategies[$strategyIdentifier])) {
            return [$this->passwordHashingStrategies[$strategyIdentifier], $strategyIdentifier];
        }

        if ($strategyIdentifier === 'default') {
            if (!isset($this->strategySettings['default'])) {
                throw new MissingConfigurationException('No default hashing strategy configured', 1320758427);
            }
            $strategyIdentifier = $this->strategySettings['default'];
        }

        if (!isset($this->strategySettings[$strategyIdentifier])) {
            throw new MissingConfigurationException('No hashing strategy with identifier "' . $strategyIdentifier . '" configured', 1320758776);
        }
        $strategyObjectName = $this->strategySettings[$strategyIdentifier];
        $this->passwordHashingStrategies[$strategyIdentifier] = $this->objectManager->get($strategyObjectName);
        return [$this->passwordHashingStrategies[$strategyIdentifier], $strategyIdentifier];
    }
732918
public function handle($request, Closure $next, $strategy = null, $sessions = true)
    {
        if ( ! ($user = $this->manager->login($strategy, $request))) {
            throw new AuthenticationException('Unauthenticated.');
        };

        if($sessions) {
            Auth::login($user);
        } else {
            Auth::setUser($user);
        }

        return $next($request);
    }
190965
public void setProxyIdpAuthenticationContextLookupStrategy(
      final Function<AuthenticationContext, ProxyIdpAuthenticationContext> strategy) {
    ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
    this.proxyIdpAuthenticationContextLookupStrategy = Constraint.isNotNull(strategy,
      "ProxyIdPAuthenticationContext lookup strategy cannot be null");
  }
1102985
public function havingConditions($strategy)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->havingConditions($strategy);

        return $instance;
    }
678288
function OAuth2Strategy (provider, client, verify) {
  Strategy.call(this)
  this.provider = provider
  this.endpoints = provider.endpoints
  this.mapping = provider.mapping
  this.client = client
  this.name = provider.id
  this.verify = verify
}
427949
protected function prepareStrategies()
    {
        $strategy = new Strategy\AppConfigStrategy();
        $strategy->setObjectManager($this->objectManager);

        $this->addStrategy('AppConfig', $strategy);
    }
284889
public function addAuthMethod($name, MethodInterface $method)
    {
        $this->getAuthentication()->addMethod($name, $method);

        return $this;
    }
984707
public Retryer<R> withBlockStrategy(BlockStrategy blockStrategy) {
        checkState(this.blockStrategy == null, "a block strategy has already been set %s", this.blockStrategy);
        this.blockStrategy = checkNotNull(blockStrategy, "BlockStrategy cannot be null");
        return this;
    }
330855
public function assignWhereAppliers(WhereClauseStrategy $strategy)
    {
        if ($this->whereAppliers) {
            $items = $strategy->getWhere();

            $strategy->clearWhere();

            foreach ($this->whereAppliers as $applier) {
                $clause = $this->connection()->where();

                call_user_func_array($applier, [$clause]);

                $strategy->whereConditions($clause);
            }

            if ($items) {
                $clause = $this->connection()->where();

                foreach ($items as $where) {
                    $clause->addWhere($where['logic'], $where['sql'], $where['params']);
                }

                $strategy->whereConditions($clause);
            }
        }

        return $this;
    }
938303
public static AutoAssignStrategy getAutoAssignStrategy(String logicalName) throws StrategyException {
        TaskInstanceStrategyFactory factory = getInstance();
        String className = factory.getStrategyClassName(logicalName, StrategyType.AutoAssignStrategy);
        return (AutoAssignStrategy) factory.getStrategyInstance(AutoAssignStrategy.class, className, null);
    }