prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Replace flask_oauthlib with Authlib
  
  **Description**
  
  flask_oauthlib has been deprecated in favour of Authlib. It would be good if airflow starts using Authlib
  
  **Use case / motivation**
  
  FlaskAppBuilder is now using Authlib. 
  Since FlaskAppBuilder is deeply integrated into Airflow, it will be good to also have this Authlib. Flask-oauthlib documentation recommends Authlib
  
  **Related Issues**
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `airflow/config_templates/default_webserver_config.py`
  Content:
  ```
  1 #
  2 # Licensed to the Apache Software Foundation (ASF) under one
  3 # or more contributor license agreements.  See the NOTICE file
  4 # distributed with this work for additional information
  5 # regarding copyright ownership.  The ASF licenses this file
  6 # to you under the Apache License, Version 2.0 (the
  7 # "License"); you may not use this file except in compliance
  8 # with the License.  You may obtain a copy of the License at
  9 #
  10 #   http://www.apache.org/licenses/LICENSE-2.0
  11 #
  12 # Unless required by applicable law or agreed to in writing,
  13 # software distributed under the License is distributed on an
  14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15 # KIND, either express or implied.  See the License for the
  16 # specific language governing permissions and limitations
  17 # under the License.
  18 """Default configuration for the Airflow webserver"""
  19 import os
  20 
  21 from flask_appbuilder.security.manager import AUTH_DB
  22 
  23 from airflow.configuration import conf
  24 
  25 # from flask_appbuilder.security.manager import AUTH_LDAP
  26 # from flask_appbuilder.security.manager import AUTH_OAUTH
  27 # from flask_appbuilder.security.manager import AUTH_OID
  28 # from flask_appbuilder.security.manager import AUTH_REMOTE_USER
  29 
  30 
  31 basedir = os.path.abspath(os.path.dirname(__file__))
  32 
  33 # The SQLAlchemy connection string.
  34 SQLALCHEMY_DATABASE_URI = conf.get('core', 'SQL_ALCHEMY_CONN')
  35 
  36 # Flask-WTF flag for CSRF
  37 WTF_CSRF_ENABLED = True
  38 
  39 # ----------------------------------------------------
  40 # AUTHENTICATION CONFIG
  41 # ----------------------------------------------------
  42 # For details on how to set up each of the following authentication, see
  43 # http://flask-appbuilder.readthedocs.io/en/latest/security.html# authentication-methods
  44 # for details.
  45 
  46 # The authentication type
  47 # AUTH_OID : Is for OpenID
  48 # AUTH_DB : Is for database
  49 # AUTH_LDAP : Is for LDAP
  50 # AUTH_REMOTE_USER : Is for using REMOTE_USER from web server
  51 # AUTH_OAUTH : Is for OAuth
  52 AUTH_TYPE = AUTH_DB
  53 
  54 # Uncomment to setup Full admin role name
  55 # AUTH_ROLE_ADMIN = 'Admin'
  56 
  57 # Uncomment to setup Public role name, no authentication needed
  58 # AUTH_ROLE_PUBLIC = 'Public'
  59 
  60 # Will allow user self registration
  61 # AUTH_USER_REGISTRATION = True
  62 
  63 # The default user self registration role
  64 # AUTH_USER_REGISTRATION_ROLE = "Public"
  65 
  66 # When using OAuth Auth, uncomment to setup provider(s) info
  67 # Google OAuth example:
  68 # OAUTH_PROVIDERS = [{
  69 #   'name':'google',
  70 #     'token_key':'access_token',
  71 #     'icon':'fa-google',
  72 #         'remote_app': {
  73 #             'base_url':'https://www.googleapis.com/oauth2/v2/',
  74 #             'request_token_params':{
  75 #                 'scope': 'email profile'
  76 #             },
  77 #             'access_token_url':'https://accounts.google.com/o/oauth2/token',
  78 #             'authorize_url':'https://accounts.google.com/o/oauth2/auth',
  79 #             'request_token_url': None,
  80 #             'consumer_key': CONSUMER_KEY,
  81 #             'consumer_secret': SECRET_KEY,
  82 #         }
  83 # }]
  84 
  85 # When using LDAP Auth, setup the ldap server
  86 # AUTH_LDAP_SERVER = "ldap://ldapserver.new"
  87 
  88 # When using OpenID Auth, uncomment to setup OpenID providers.
  89 # example for OpenID authentication
  90 # OPENID_PROVIDERS = [
  91 #    { 'name': 'Yahoo', 'url': 'https://me.yahoo.com' },
  92 #    { 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' },
  93 #    { 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },
  94 #    { 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]
  95 
  96 # ----------------------------------------------------
  97 # Theme CONFIG
  98 # ----------------------------------------------------
  99 # Flask App Builder comes up with a number of predefined themes
  100 # that you can use for Apache Airflow.
  101 # http://flask-appbuilder.readthedocs.io/en/latest/customizing.html#changing-themes
  102 # Please make sure to remove "navbar_color" configuration from airflow.cfg
  103 # in order to fully utilize the theme. (or use that property in conjunction with theme)
  104 # APP_THEME = "bootstrap-theme.css"  # default bootstrap
  105 # APP_THEME = "amelia.css"
  106 # APP_THEME = "cerulean.css"
  107 # APP_THEME = "cosmo.css"
  108 # APP_THEME = "cyborg.css"
  109 # APP_THEME = "darkly.css"
  110 # APP_THEME = "flatly.css"
  111 # APP_THEME = "journal.css"
  112 # APP_THEME = "lumen.css"
  113 # APP_THEME = "paper.css"
  114 # APP_THEME = "readable.css"
  115 # APP_THEME = "sandstone.css"
  116 # APP_THEME = "simplex.css"
  117 # APP_THEME = "slate.css"
  118 # APP_THEME = "solar.css"
  119 # APP_THEME = "spacelab.css"
  120 # APP_THEME = "superhero.css"
  121 # APP_THEME = "united.css"
  122 # APP_THEME = "yeti.css"
  123
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/airflow/config_templates/default_webserver_config.py b/airflow/config_templates/default_webserver_config.py
  --- a/airflow/config_templates/default_webserver_config.py
  +++ b/airflow/config_templates/default_webserver_config.py
  @@ -70,15 +70,15 @@
   #     'token_key':'access_token',
   #     'icon':'fa-google',
   #         'remote_app': {
  -#             'base_url':'https://www.googleapis.com/oauth2/v2/',
  -#             'request_token_params':{
  +#             'api_base_url':'https://www.googleapis.com/oauth2/v2/',
  +#             'client_kwargs':{
   #                 'scope': 'email profile'
   #             },
   #             'access_token_url':'https://accounts.google.com/o/oauth2/token',
   #             'authorize_url':'https://accounts.google.com/o/oauth2/auth',
   #             'request_token_url': None,
  -#             'consumer_key': CONSUMER_KEY,
  -#             'consumer_secret': SECRET_KEY,
  +#             'client_id': GOOGLE_KEY,
  +#             'client_secret': GOOGLE_SECRET_KEY,
   #         }
   # }]
  
verification_info: {"golden_diff": "diff --git a/airflow/config_templates/default_webserver_config.py b/airflow/config_templates/default_webserver_config.py\n--- a/airflow/config_templates/default_webserver_config.py\n+++ b/airflow/config_templates/default_webserver_config.py\n@@ -70,15 +70,15 @@\n #     'token_key':'access_token',\n #     'icon':'fa-google',\n #         'remote_app': {\n-#             'base_url':'https://www.googleapis.com/oauth2/v2/',\n-#             'request_token_params':{\n+#             'api_base_url':'https://www.googleapis.com/oauth2/v2/',\n+#             'client_kwargs':{\n #                 'scope': 'email profile'\n #             },\n #             'access_token_url':'https://accounts.google.com/o/oauth2/token',\n #             'authorize_url':'https://accounts.google.com/o/oauth2/auth',\n #             'request_token_url': None,\n-#             'consumer_key': CONSUMER_KEY,\n-#             'consumer_secret': SECRET_KEY,\n+#             'client_id': GOOGLE_KEY,\n+#             'client_secret': GOOGLE_SECRET_KEY,\n #         }\n # }]\n", "issue": "Replace flask_oauthlib with Authlib\n\r\n**Description**\r\n\r\nflask_oauthlib has been deprecated in favour of Authlib. It would be good if airflow starts using Authlib\r\n\r\n**Use case / motivation**\r\n\r\nFlaskAppBuilder is now using Authlib. \r\nSince FlaskAppBuilder is deeply integrated into Airflow, it will be good to also have this Authlib. Flask-oauthlib documentation recommends Authlib\r\n\r\n**Related Issues**\r\n\n", "before_files": [{"content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\"\"\"Default configuration for the Airflow webserver\"\"\"\nimport os\n\nfrom flask_appbuilder.security.manager import AUTH_DB\n\nfrom airflow.configuration import conf\n\n# from flask_appbuilder.security.manager import AUTH_LDAP\n# from flask_appbuilder.security.manager import AUTH_OAUTH\n# from flask_appbuilder.security.manager import AUTH_OID\n# from flask_appbuilder.security.manager import AUTH_REMOTE_USER\n\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n# The SQLAlchemy connection string.\nSQLALCHEMY_DATABASE_URI = conf.get('core', 'SQL_ALCHEMY_CONN')\n\n# Flask-WTF flag for CSRF\nWTF_CSRF_ENABLED = True\n\n# ----------------------------------------------------\n# AUTHENTICATION CONFIG\n# ----------------------------------------------------\n# For details on how to set up each of the following authentication, see\n# http://flask-appbuilder.readthedocs.io/en/latest/security.html# authentication-methods\n# for details.\n\n# The authentication type\n# AUTH_OID : Is for OpenID\n# AUTH_DB : Is for database\n# AUTH_LDAP : Is for LDAP\n# AUTH_REMOTE_USER : Is for using REMOTE_USER from web server\n# AUTH_OAUTH : Is for OAuth\nAUTH_TYPE = AUTH_DB\n\n# Uncomment to setup Full admin role name\n# AUTH_ROLE_ADMIN = 'Admin'\n\n# Uncomment to setup Public role name, no authentication needed\n# AUTH_ROLE_PUBLIC = 'Public'\n\n# Will allow user self registration\n# AUTH_USER_REGISTRATION = True\n\n# The default user self registration role\n# AUTH_USER_REGISTRATION_ROLE = \"Public\"\n\n# When using OAuth Auth, uncomment to setup provider(s) info\n# Google OAuth example:\n# OAUTH_PROVIDERS = [{\n#   'name':'google',\n#     'token_key':'access_token',\n#     'icon':'fa-google',\n#         'remote_app': {\n#             'base_url':'https://www.googleapis.com/oauth2/v2/',\n#             'request_token_params':{\n#                 'scope': 'email profile'\n#             },\n#             'access_token_url':'https://accounts.google.com/o/oauth2/token',\n#             'authorize_url':'https://accounts.google.com/o/oauth2/auth',\n#             'request_token_url': None,\n#             'consumer_key': CONSUMER_KEY,\n#             'consumer_secret': SECRET_KEY,\n#         }\n# }]\n\n# When using LDAP Auth, setup the ldap server\n# AUTH_LDAP_SERVER = \"ldap://ldapserver.new\"\n\n# When using OpenID Auth, uncomment to setup OpenID providers.\n# example for OpenID authentication\n# OPENID_PROVIDERS = [\n#    { 'name': 'Yahoo', 'url': 'https://me.yahoo.com' },\n#    { 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' },\n#    { 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },\n#    { 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]\n\n# ----------------------------------------------------\n# Theme CONFIG\n# ----------------------------------------------------\n# Flask App Builder comes up with a number of predefined themes\n# that you can use for Apache Airflow.\n# http://flask-appbuilder.readthedocs.io/en/latest/customizing.html#changing-themes\n# Please make sure to remove \"navbar_color\" configuration from airflow.cfg\n# in order to fully utilize the theme. (or use that property in conjunction with theme)\n# APP_THEME = \"bootstrap-theme.css\"  # default bootstrap\n# APP_THEME = \"amelia.css\"\n# APP_THEME = \"cerulean.css\"\n# APP_THEME = \"cosmo.css\"\n# APP_THEME = \"cyborg.css\"\n# APP_THEME = \"darkly.css\"\n# APP_THEME = \"flatly.css\"\n# APP_THEME = \"journal.css\"\n# APP_THEME = \"lumen.css\"\n# APP_THEME = \"paper.css\"\n# APP_THEME = \"readable.css\"\n# APP_THEME = \"sandstone.css\"\n# APP_THEME = \"simplex.css\"\n# APP_THEME = \"slate.css\"\n# APP_THEME = \"solar.css\"\n# APP_THEME = \"spacelab.css\"\n# APP_THEME = \"superhero.css\"\n# APP_THEME = \"united.css\"\n# APP_THEME = \"yeti.css\"\n", "path": "airflow/config_templates/default_webserver_config.py"}], "after_files": [{"content": "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\"\"\"Default configuration for the Airflow webserver\"\"\"\nimport os\n\nfrom flask_appbuilder.security.manager import AUTH_DB\n\nfrom airflow.configuration import conf\n\n# from flask_appbuilder.security.manager import AUTH_LDAP\n# from flask_appbuilder.security.manager import AUTH_OAUTH\n# from flask_appbuilder.security.manager import AUTH_OID\n# from flask_appbuilder.security.manager import AUTH_REMOTE_USER\n\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n# The SQLAlchemy connection string.\nSQLALCHEMY_DATABASE_URI = conf.get('core', 'SQL_ALCHEMY_CONN')\n\n# Flask-WTF flag for CSRF\nWTF_CSRF_ENABLED = True\n\n# ----------------------------------------------------\n# AUTHENTICATION CONFIG\n# ----------------------------------------------------\n# For details on how to set up each of the following authentication, see\n# http://flask-appbuilder.readthedocs.io/en/latest/security.html# authentication-methods\n# for details.\n\n# The authentication type\n# AUTH_OID : Is for OpenID\n# AUTH_DB : Is for database\n# AUTH_LDAP : Is for LDAP\n# AUTH_REMOTE_USER : Is for using REMOTE_USER from web server\n# AUTH_OAUTH : Is for OAuth\nAUTH_TYPE = AUTH_DB\n\n# Uncomment to setup Full admin role name\n# AUTH_ROLE_ADMIN = 'Admin'\n\n# Uncomment to setup Public role name, no authentication needed\n# AUTH_ROLE_PUBLIC = 'Public'\n\n# Will allow user self registration\n# AUTH_USER_REGISTRATION = True\n\n# The default user self registration role\n# AUTH_USER_REGISTRATION_ROLE = \"Public\"\n\n# When using OAuth Auth, uncomment to setup provider(s) info\n# Google OAuth example:\n# OAUTH_PROVIDERS = [{\n#   'name':'google',\n#     'token_key':'access_token',\n#     'icon':'fa-google',\n#         'remote_app': {\n#             'api_base_url':'https://www.googleapis.com/oauth2/v2/',\n#             'client_kwargs':{\n#                 'scope': 'email profile'\n#             },\n#             'access_token_url':'https://accounts.google.com/o/oauth2/token',\n#             'authorize_url':'https://accounts.google.com/o/oauth2/auth',\n#             'request_token_url': None,\n#             'client_id': GOOGLE_KEY,\n#             'client_secret': GOOGLE_SECRET_KEY,\n#         }\n# }]\n\n# When using LDAP Auth, setup the ldap server\n# AUTH_LDAP_SERVER = \"ldap://ldapserver.new\"\n\n# When using OpenID Auth, uncomment to setup OpenID providers.\n# example for OpenID authentication\n# OPENID_PROVIDERS = [\n#    { 'name': 'Yahoo', 'url': 'https://me.yahoo.com' },\n#    { 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' },\n#    { 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },\n#    { 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]\n\n# ----------------------------------------------------\n# Theme CONFIG\n# ----------------------------------------------------\n# Flask App Builder comes up with a number of predefined themes\n# that you can use for Apache Airflow.\n# http://flask-appbuilder.readthedocs.io/en/latest/customizing.html#changing-themes\n# Please make sure to remove \"navbar_color\" configuration from airflow.cfg\n# in order to fully utilize the theme. (or use that property in conjunction with theme)\n# APP_THEME = \"bootstrap-theme.css\"  # default bootstrap\n# APP_THEME = \"amelia.css\"\n# APP_THEME = \"cerulean.css\"\n# APP_THEME = \"cosmo.css\"\n# APP_THEME = \"cyborg.css\"\n# APP_THEME = \"darkly.css\"\n# APP_THEME = \"flatly.css\"\n# APP_THEME = \"journal.css\"\n# APP_THEME = \"lumen.css\"\n# APP_THEME = \"paper.css\"\n# APP_THEME = \"readable.css\"\n# APP_THEME = \"sandstone.css\"\n# APP_THEME = \"simplex.css\"\n# APP_THEME = \"slate.css\"\n# APP_THEME = \"solar.css\"\n# APP_THEME = \"spacelab.css\"\n# APP_THEME = \"superhero.css\"\n# APP_THEME = \"united.css\"\n# APP_THEME = \"yeti.css\"\n", "path": "airflow/config_templates/default_webserver_config.py"}]}