def authenticate(request):
 oauthlib_core = get_oauthlib_core()
 (valid, r) = oauthlib_core.verify_request(request, scopes=[])
 if valid:
  return (r.user, r.access_token)
 else:
  return (None, None)

def authenticate ( request ) : oauthlib_core = get_oauthlib_core ( ) ( valid , r ) = oauthlib_core . verify_request ( request , scopes = [ ] ) if valid : return ( r . user , r . access_token ) else : return ( None , None )
return a keystone client object .