Returns the service identity class.

@param string $service the service name.
@param array[optional] $options
@return IAuthService the identity class.
542043
public function getIdentity($service, $options = array()) {
		$service = strtolower($service);
		if (!isset($this->services[$service])) {
			throw new EAuthException(Yii::t('eauth', 'Undefined service name: {service}.', array('{service}' => $service)), 500);
		}
		$service = $this->services[$service];

		$class = $service['class'];
		$point = strrpos($class, '.');
		// if it is yii path alias
		if ($point > 0) {
			Yii::import($class);
			$class = substr($class, $point + 1);
		}
		unset($service['class']);
		$identity = new $class();
		$identity->init($this, array_merge($service, $options));
		return $identity;
	}
1083547
public function getService($service, $async = true)
    {
        if ($async) {
            $group = 'async';
        } else {
            $group = 'sync';
        }

        if (!isset($this->_service[$service][$group])) {
            $obj = new Client($this->getServiceUrls($service), $async);
            $this->trigger(static::EVENT_AFTER_INIT_CLIENT, new Event([
                'sender' => &$obj
            ]));
            $this->_service[$service][$group] = $obj;
        }

        return $this->_service[$service][$group];
    }
929924
public function getClient(array $options = [])
    {
        if ($this->client) {
            return $this->client;
        }

        $this->client = new Client(
            [
                'base_url' => $this->baseUrl,
                'defaults' => [
                    'headers' => [
                        'Authorization' => 'Bearer ' . $this->accessToken,
                    ]
                ]
            ]
        );

        return $this->client;
    }
1149349
public function getService($service = null)
    {
        if ( $service and ! array_key_exists($service, $this->service) )
        {
            $this->setService($service);
        }

        $this->setToken();

        return $this->service[$service];
    }
92148
protected function retrieveToken( $service ) {
        $stsUri = $this->getSTSUrl( $this->settings->username );

        if ( $stsUri !== null ) {
            $assertResponse = $this->client->attemptSoapResponse( $stsUri, function() use ( $stsUri ) {
                return $this->generateAssertRequest( $stsUri );
            } );

            $assertToken = $this->extractAssertToken( $assertResponse );

            $tokenResponse = $this->client->attemptSoapResponse( 'sts', function() use ( $assertToken ) {
                return $this->generateAssertTokenRequest( $assertToken );
            } );
        } else {
            $tokenResponse = $this->client->attemptSoapResponse( 'sts', function() use ( $service ) {
                return $this->generateTokenRequest( $service );
            } );
        }

        $token = $this->extractToken( $tokenResponse );

        $this->client->logger->info( 'Issued a new security token [' . $service . '] - expires at: ' . date( 'r', $token->expiryTime ) );

        return $token;
    }
1186696
private function getId($options)
    {
        $id = '';
        if (!isset($options['id'])) {
            $id = $options['name'];
        } else {
            $id = $options['id'];
        }

        return $id;
    }
1050130
public function getIOService()
    {
        if (null === $this->ioService) {
            $this->ioService = new IOService(
                $this->client,
                $this->inputDispatcher,
                $this->outputVisitor,
                $this->requestParser
            );
        }

        return $this->ioService;
    }
127490
protected function initService(string $type, string $alias, array $options)
    {
        $id      = $this->resolverFactory->resolve($type, $alias);
        $service = $this->get($id);
        
        $service->setOptions($options);
        
        return $service;
    }
1229749
public function subscriptions(array $options = [])
    {
        if (!isset($this->subscriptions)) {
            $options['customer_uuid'] = $this->uuid;
            $this->subscriptions = Subscription::all($options);
        }
        return $this->subscriptions;
    }
844154
public function getMapper($mapperClass = null, array $options = [])
    {
        $mapperClass = $mapperClass ?? $this->mapper ?? $this->serviceAlias;

        if (!array_key_exists($mapperClass, $this->mappers)) {
            $this->setMapper($mapperClass, $options);
        }

        return $this->mappers[$mapperClass];
    }
331730
final public function getIdentifier($identifier = null)
	{
		if(isset($identifier)) {
		    $result = $this->__service_container->getIdentifier($identifier);
		} else {
		    $result = $this->__service_identifier; 
		}
	    
	    return $result;
	}
1115378
private function getService($class)
    {
        if (!array_key_exists($class, $this->services)) {
            $this->services[$class] = new $class($this->getClient(), $this->getLogger());
        }

        return $this->services[$class];
    }
670908
public function load($id, $options = null)
	{
	    $id = $this->normalizeServiceId($id);
	    
	    if(!isset($this->services[$id])){
	        throw new Exception\ServiceNotFoundException(
                sprintf('Service ID "%s" does not exist', $id)
	        );
	    }
	    
        if($options == null){
            $options = $this->services[$id]['options'];
        }
        
        return $this->getServicePluginManager()->get($id, $options, true, true);
	}
845852
public function getService($serviceClass, $clientCustomerId = null, $credentials = null)
    {
        $adwordsServices = new AdWordsServices();

        $session = $this->session($clientCustomerId, $credentials);

        return $adwordsServices->get($session, $serviceClass);
    }
708203
public function getEncoderService(array $options = [])
	{
		$options = $options ?: $this->getOptions();
		
		if (isset($options[static::OPTION_USE_QUEUE]) && $options[static::OPTION_USE_QUEUE])
		{
			/** @noinspection ExceptionsAnnotatingAndHandlingInspection */
			return new EncoderQueue($this->options[static::OPTION_USE_QUEUE], $options);
		}
		
		/** @noinspection ExceptionsAnnotatingAndHandlingInspection */
		return new Encoder($options);
	}
861264
protected function _getClassName($alias, array $options = [])
    {
        if (empty($options['className'])) {
            $options['className'] = Inflector::camelize($alias);
        }

        return App::className($options['className'], 'Model/Table', 'Table');
    }
207351
protected function getAuthenticationService()
    {
        if ($this->authenticationService === null) {
            $this->authenticationService = new AuthenticationService($this->getStorage());
        }
        
        return $this->authenticationService;
    }