<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def authenticate(self, provider):
 """ Starts OAuth authorization flow, will redirect to 3rd party site. """

        callback_url = url_for(".callback", provider=provider, _external=True)
        provider = self.get_provider(provider)
        session['next'] = request.args.get('next') or ''
        return provider.authorize(callback_url)