Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(login): ✨ add support for business login parameter conf… #268

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pyfacebook/api/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import re
import time
from urllib.parse import parse_qsl, urlparse
from typing import Dict, List, Optional, Tuple
from typing import Any, Dict, List, Optional, Tuple
from warnings import warn

import requests
Expand All @@ -30,6 +30,7 @@ class GraphAPI:
"v17.0",
"v18.0",
"v19.0",
"v20.0",
]
GRAPH_URL = "https://graph.facebook.com/"
AUTHORIZATION_URL = "https://www.facebook.com/dialog/oauth"
Expand Down Expand Up @@ -541,6 +542,7 @@ def get_authorization_url(
redirect_uri: Optional[str] = None,
scope: Optional[List[str]] = None,
state: Optional[str] = None,
url_kwargs: Optional[Dict[str, Any]] = None,
**kwargs,
) -> Tuple[str, str]:
"""
Expand All @@ -551,13 +553,17 @@ def get_authorization_url(
Note: Your redirect uri need be set to `Valid OAuth redirect URIs` items in App Dashboard.
:param scope: A list of permission string to request from the person using your app.
:param state: A CSRF token that will be passed to the redirect URL.
:param url_kwargs: Additional parameters for generate authorization url. like config_id.
:param kwargs: Additional parameters for oauth.
:return: URL to do oauth and state
"""
session = self._get_oauth_session(
redirect_uri=redirect_uri, scope=scope, state=state, **kwargs
)
authorization_url, state = session.authorization_url(url=self.authorization_url)
url_kwargs = {} if url_kwargs is None else url_kwargs
authorization_url, state = session.authorization_url(
url=self.authorization_url, **url_kwargs
)
return authorization_url, state

def exchange_user_access_token(
Expand Down
Loading