public function getAuthType(\core_kernel_classes_Resource $resource = null)
    {
        if ($resource) {
            $authTypeUri = $resource->getUri();
            foreach ($this->getOption(self::OPTION_TYPES) as $type) {
                if ($type instanceof AbstractAuthType && $type->getAuthClass()->getUri() == $authTypeUri) {
                    $authType = $type;
                }
            }
        } else {
            $authType = $this->getOption(self::OPTION_DEFAULT_TYPE);
        }

        if (!isset($authType) || !is_a($authType, AbstractAuthType::class)) {
            throw new \common_Exception('Auth type not defined');
        }

        return $authType;
    }
public function getAuthType(\core_kernel_classes_Resource $resource = null)
    {
        if ($resource) {
            $authTypeUri = $resource->getUri();
            foreach ($this->getOption(self::OPTION_TYPES) as $type) {
                if ($type instanceof AbstractAuthType && $type->getAuthClass()->getUri() == $authTypeUri) {
                    $authType = $type;
                }
            }
        } else {
            $authType = $this->getOption(self::OPTION_DEFAULT_TYPE);
        }

        if (!isset($authType) || !is_a($authType, AbstractAuthType::class)) {
            throw new \common_Exception('Auth type not defined');
        }

        return $authType;
    }
public function getAuthType ( \ core_kernel_classes_Resource $ resource = null ) { if ( $ resource ) { $ authTypeUri = $ resource -> getUri ( ) ; foreach ( $ this -> getOption ( self :: OPTION_TYPES ) as $ type ) { if ( $ type instanceof AbstractAuthType && $ type -> getAuthClass ( ) -> getUri ( ) == $ authTypeUri ) { $ authType = $ type ; } } } else { $ authType = $ this -> getOption ( self :: OPTION_DEFAULT_TYPE ) ; } if ( ! isset ( $ authType ) || ! is_a ( $ authType , AbstractAuthType :: class ) ) { throw new \ common_Exception ( 'Auth type not defined' ) ; } return $ authType ; }
Get the authType form config

@param \core_kernel_classes_Resource|null $resource
@return AbstractAuthType
@throws \common_Exception
Get the authType form config