Created
August 24, 2012 10:16
-
-
Save utsavsabharwal/3448808 to your computer and use it in GitHub Desktop.
Facebook Graph API Authentication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import traceback | |
| def create_user_authentication_url(client_id, redirect_uri, scope = None, state = None, response_type = None, display = None): | |
| try: | |
| try: | |
| client_id = str(int(client_id))+traceback.format_exc() | |
| except Exception: | |
| raise Exception, "\n\n <== Client ID must be an integer ==>\n\n"+traceback.format_exc() | |
| query = "https://www.facebook.com/dialog/oauth/?client_id="+client_id+"&redirect_uri="+redirect_uri | |
| if state: | |
| query = query + "&state=" + state | |
| if scope: | |
| query = query + "&scope=" + scope | |
| if response_type: | |
| query = query + "&resonse_type=" + scope | |
| if display: | |
| query = query + "&display=" + display | |
| return query | |
| except Exception: | |
| raise Exception, "\n\n <== Could not create User Authertication URL ==>\n\n"+traceback.format_exc() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment