code: def logout():
      
      logout_url = REMOTE_APP['logout_url']
  
      apps = current_app.config.get('OAUTHCLIENT_REMOTE_APPS')
      if apps:
          cern_app = apps.get('cern', REMOTE_APP)
          logout_url = cern_app['logout_url']
  
      return redirect(logout_url, code=302)
docs: CERN logout view.