Factor out the function getAuthenticationUrl().