jackwener/OpenCLI · error · AuthRequiredError
linkedin.com
Error message
linkedin.com
What it means
The linkedin timeline command scrolls the home feed collecting posts; if a login wall was detected (sawLoginWall) and zero posts were collected, it throws AuthRequiredError with domain 'linkedin.com', indicating the browser is not signed in so the feed cannot be read.
Solutions
- Run the LinkedIn auth/login flow in the browser and confirm the home feed shows posts when opened manually
- Re-run the timeline command after sign-in
- Use a persistent browser profile so the session cookie survives restarts
- Avoid IP ranges/proxies that trigger LinkedIn's forced login wall
Defensive patterns
Strategy: try-catch
Validate before calling
const cookies = await page.getCookies({ url: 'https://www.linkedin.com' });
if (!cookies.some(c => c.name === 'li_at' && c.value)) throw new Error('Not signed in to LinkedIn'); Type guard
const isAuthRequired = (e) => e instanceof Error && /AuthRequired|signed-in browser session/.test(e.message);
Try / catch
try {
const posts = await linkedinTimeline({ limit });
} catch (e) {
if (isAuthRequired(e)) { await linkedinLogin(); return linkedinTimeline({ limit }); }
throw e;
} Prevention
- Complete the login flow once per browser profile and reuse the profile
- Check the home feed renders signed-in before running timeline fetches
- Use stable residential IPs; avoid datacenter proxies that trigger login walls
- Refresh the session periodically on long-running profiles
When it happens
Trigger: Fetching the LinkedIn timeline while the browser session is logged out or the login wall appeared before any posts rendered, with posts.length === 0.
Common situations: Expired LinkedIn session in the automation browser; first run without completing the site login flow; LinkedIn showing an interstitial login page on a fresh profile; region or network triggering a forced login wall.
Related errors
- LinkedIn messengerMessages API authentication failed
- www.rednote.com
- amazon.com
- AUTH_REQUIRED
- AUTH_REQUIRED
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/6f7ad8521bd2d4ae.
Report an issue: GitHub.
Appendix: source
Thrown at clis/linkedin/timeline.js:495
columns: ['rank', 'author', 'author_url', 'headline', 'text', 'posted_at', 'reactions', 'comments', 'url'],
func: async (page, kwargs) => {
const limit = Math.max(1, Math.min(kwargs.limit ?? 20, 100));
await page.goto('https://www.linkedin.com/feed/');
await page.wait(4);
let posts = [];
let sawLoginWall = false;
for (let i = 0; i < 6 && posts.length < limit; i++) {
const batch = await extractVisiblePosts(page);
if (batch?.loginRequired)
sawLoginWall = true;
posts = mergeTimelinePosts(posts, Array.isArray(batch?.posts) ? batch.posts : []);
if (posts.length >= limit)
break;
await page.autoScroll({ times: 1, delayMs: 1200 });
await page.wait(1);
}
if (sawLoginWall && posts.length === 0) {
throw new AuthRequiredError('linkedin.com', 'LinkedIn timeline requires an active signed-in browser session');
}
if (posts.length === 0) {
throw new EmptyResultError('linkedin timeline', 'Make sure your LinkedIn home feed is visible in the browser.');
}
return posts.slice(0, limit).map((post, index) => ({
rank: index + 1,
...post,
}));
},
});
export const __test__ = {
parseMetric,
buildPostId,
mergeTimelinePosts,
normalizeTimestamp,
};
View on GitHub (pinned to 49907e53dc)