Refactor web authentication methods

Jira issue: WP-955