8
8
import re
9
9
import time
10
10
from urllib .parse import parse_qsl , urlparse
11
- from typing import Dict , List , Optional , Tuple
11
+ from typing import Any , Dict , List , Optional , Tuple
12
12
from warnings import warn
13
13
14
14
import requests
@@ -30,6 +30,7 @@ class GraphAPI:
30
30
"v17.0" ,
31
31
"v18.0" ,
32
32
"v19.0" ,
33
+ "v20.0" ,
33
34
]
34
35
GRAPH_URL = "https://graph.facebook.com/"
35
36
AUTHORIZATION_URL = "https://www.facebook.com/dialog/oauth"
@@ -541,6 +542,7 @@ def get_authorization_url(
541
542
redirect_uri : Optional [str ] = None ,
542
543
scope : Optional [List [str ]] = None ,
543
544
state : Optional [str ] = None ,
545
+ url_kwargs : Optional [Dict [str , Any ]] = None ,
544
546
** kwargs ,
545
547
) -> Tuple [str , str ]:
546
548
"""
@@ -551,13 +553,17 @@ def get_authorization_url(
551
553
Note: Your redirect uri need be set to `Valid OAuth redirect URIs` items in App Dashboard.
552
554
:param scope: A list of permission string to request from the person using your app.
553
555
: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.
554
557
:param kwargs: Additional parameters for oauth.
555
558
:return: URL to do oauth and state
556
559
"""
557
560
session = self ._get_oauth_session (
558
561
redirect_uri = redirect_uri , scope = scope , state = state , ** kwargs
559
562
)
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 , ** url_kwargs
566
+ )
561
567
return authorization_url , state
562
568
563
569
def exchange_user_access_token (
0 commit comments