def get_access_token(request):
    # [todo] - add doc string for get_access_token
    session = OAuth1Session(client_key=settings.QUICKBOOKS['CONSUMER_KEY'],
                            client_secret=settings.QUICKBOOKS['CONSUMER_SECRET'],
                            resource_owner_key=request.session['qb_oauth_token'],
                            resource_owner_secret=request.session['qb_oauth_token_secret'])

    remote_response = session.parse_authorization_response('?{}'.format(request.META.get('QUERY_STRING')))
    realm_id = remote_response['realmId']
    data_source = remote_response['dataSource']
    oauth_verifier = remote_response['oauth_verifier']

    # [review] - Possible bug? This should be taken care of by session.parse_authorization_response
    session.auth.client.verifier = unicode(oauth_verifier)

    response = session.fetch_access_token(ACCESS_TOKEN_URL)

    # Delete any existing access tokens
    request.user.quickbookstoken_set.all().delete()

    token = QuickbooksToken.objects.create(
        user=request.user,
        access_token=response['oauth_token'],
        access_token_secret=response['oauth_token_secret'],
        realm_id=realm_id,
        data_source=data_source)

    # Cache blue dot menu
    try:
        request.session[BLUE_DOT_CACHE_KEY] = None
        blue_dot_menu(request)
    except AttributeError:
        raise Exception('The sessions framework must be installed for this ' +
                        'application to work.')

    # Let everyone else know we conneted
    qb_connected.send(None, token=token)

    return render_to_response('oauth_callback.html',
                              {'complete_url': settings.QUICKBOOKS['ACCESS_COMPLETE_URL']})