Methods
page.authenticate()
Navigates to a URL and waits for authentication to complete.
startURL: URL to navigate to for authenticationauthEvaluator: Function that checks if authentication is completeoptions(optional): Authentication options
Promise<AuthStatus> - Either 'authenticated' or 'aborted'
Examples:
page.waitForAuthentication()
Waits for authentication to complete without navigating.
authEvaluator: Function that checks if authentication is completeoptions(optional): Authentication options
Promise<AuthStatus> - Either 'authenticated' or 'aborted'
Example:
Complete examples
OAuth flow
Social login
Two-factor authentication
Session-based authentication
Mobile app authentication
Best practices
Let users handle credentials
Let users handle credentials
With Uplink, users authenticate themselves on their own devices:
Use appropriate timeouts
Use appropriate timeouts
Authentication often requires user interaction, so use longer timeouts:
Check multiple indicators
Check multiple indicators
Verify authentication using multiple methods:
Handle aborted authentication
Handle aborted authentication
Always handle the aborted case:
Store tokens after auth
Store tokens after auth
Extract and store authentication tokens for later use:
Related
Cookies
Manage authentication cookies
Waiting
Wait for authentication indicators
Navigation
Navigate to auth pages
Page overview
Back to Page API overview