Skip to content

Commit a39b0f9

Browse files
authored
Merge pull request #268 from MerleLiuKun/feat-business-login
feat(login): ✨ add support for business login parameter conf…
2 parents da33dd1 + 65e77dc commit a39b0f9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pyfacebook/api/graph.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import re
99
import time
1010
from urllib.parse import parse_qsl, urlparse
11-
from typing import Dict, List, Optional, Tuple
11+
from typing import Any, Dict, List, Optional, Tuple
1212
from warnings import warn
1313

1414
import 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,17 @@ 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, **url_kwargs
566+
)
561567
return authorization_url, state
562568

563569
def exchange_user_access_token(

0 commit comments

Comments
 (0)