[Bug]: Authentication required. Call authenticate() first in Docker
crawl4ai version
0.6.1
Expected Behavior
When setting security.enabled: false and jwt_enabled: false in the config.yml, I expect the Crawl4AI server to allow API access without requiring authentication (i.e., calling authenticate() should not be needed).
I should be able to directly use Crawl4aiDockerClient or send requests to /crawl without providing a JWT token.
Current Behavior
Despite setting security.enabled: false and jwt_enabled: false in the server configuration, when trying to crawl via the SDK, I get this error:
crawl4ai.docker_client.Crawl4aiClientError: Authentication required. Call authenticate() first.
This happens immediately when calling client.crawl(...), even though authentication should be disabled according to the config.
It seems the client always expects authentication to be active, without checking if security is actually turned off.
Is this reproducible?
Yes
Inputs Causing the Bug
Steps to Reproduce
Code snippets
OS
Macos
Python version
3.10
Browser
No response
Browser version
No response
Error logs & Screenshots (if applicable)
No response
It's 100% expecting self._token before it does ANYTHING -- "docker_client.py" line 98
`
async def crawl(
self,
urls: List[str],
browser_config: Optional[BrowserConfig] = None,
crawler_config: Optional[CrawlerRunConfig] = None
) -> Union[CrawlResult, List[CrawlResult], AsyncGenerator[CrawlResult, None]]:
"""Execute a crawl operation."""
if not self._token:
raise Crawl4aiClientError("Authentication required. Call authenticate() first.")
await self._check_server()
`
Confirmed manually setting the token allows it to work:
client._token = "test"
Hello @QuangTQV this issue has been resolved in the latest Docker build. Try it out and let us know.