code: def find_remote_by_client_id(client_id):
      
      for remote in current_oauthclient.oauth.remote_apps.values():
          if remote.name == 'cern' and remote.consumer_key == client_id:
              return remote
docs: Return a remote application based with given client ID.