88import re
99import time
1010from urllib .parse import parse_qsl , urlparse
11- from typing import Dict , List , Optional , Tuple
11+ from typing import Any , Dict , List , Optional , Tuple
1212from warnings import warn
1313
1414import requests
@@ -30,6 +30,7 @@ class GraphAPI:
3030 "v17.0" ,
3131 "v18.0" ,
3232 "v19.0" ,
33+ "v20.0"
3334 ]
3435 GRAPH_URL = "https://graph.facebook.com/"
3536 AUTHORIZATION_URL = "https://www.facebook.com/dialog/oauth"
@@ -541,6 +542,7 @@ def get_authorization_url(
541542 redirect_uri : Optional [str ] = None ,
542543 scope : Optional [List [str ]] = None ,
543544 state : Optional [str ] = None ,
545+ url_kwargs : Optional [Dict [str , Any ]] = None ,
544546 ** kwargs ,
545547 ) -> Tuple [str , str ]:
546548 """
@@ -551,13 +553,18 @@ def get_authorization_url(
551553 Note: Your redirect uri need be set to `Valid OAuth redirect URIs` items in App Dashboard.
552554 :param scope: A list of permission string to request from the person using your app.
553555 :param state: A CSRF token that will be passed to the redirect URL.
556+ :param url_kwargs: Additional parameters for generate authorization url. like config_id.
554557 :param kwargs: Additional parameters for oauth.
555558 :return: URL to do oauth and state
556559 """
557560 session = self ._get_oauth_session (
558561 redirect_uri = redirect_uri , scope = scope , state = state , ** kwargs
559562 )
560- authorization_url , state = session .authorization_url (url = self .authorization_url )
563+ url_kwargs = {} if url_kwargs is None else url_kwargs
564+ authorization_url , state = session .authorization_url (
565+ url = self .authorization_url ,
566+ ** url_kwargs
567+ )
561568 return authorization_url , state
562569
563570 def exchange_user_access_token (
0 commit comments