Facebook Developers
DocumentationSupportBlogAppsLog In
  • Getting Started
  • Core Concepts
  • Advanced Topics
  • SDK Reference
    • JavaScript SDK
    • PHP SDK
    • iOS SDK
    • Android SDK
  • Tools
  • Core Methods
    • FB.api
    • FB.init
    • FB.ui
  • Auth Methods
    • FB.getAuthResponse
    • FB.getLoginStatus
    • FB.getSession
    • FB.login
    • FB.logout
  • Event Handling
    • FB.Event.subscribe
    • FB.Event.unsubscribe
  • XFBML Methods
    • FB.XFBML.parse
  • Canvas Methods
    • FB.Canvas.Prefetcher.addStaticResource
    • FB.Canvas.Prefetcher.setCollectionMode
    • FB.Canvas.getPageInfo
    • FB.Canvas.hideFlashElement
    • FB.Canvas.scrollTo
    • FB.Canvas.setAutoGrow
    • FB.Canvas.setDoneLoading
    • FB.Canvas.setSize
    • FB.Canvas.setUrlHandler
    • FB.Canvas.showFlashElement
    • FB.Canvas.startTimer
    • FB.Canvas.stopTimer

FB.getAuthResponse

SDK Reference › JavaScript SDK › FB.getAuthResponse
As of December 13th, 2011, the JavaScript SDK now only supports OAuth 2.0 for authentication. The ability to enable OAuth 2.0 in the JS SDK was first introduced in July. All apps were given until October 1, 2011 to test and migrate. With this change, please ensure that you are using FB.getAuthResponse to obtain the access token instead of FB.getSession. Read more about the specific changes here.

Synchronous accessor for the current authResponse. The synchronous nature of this method is what sets it apart from the other login methods.

This method is similar in nature to FB.getLoginStatus(), but it returns just the authResponse object. Many parts of your application already assume the user is connected with your application. In such cases, you may want to avoid the overhead of making asynchronous calls.

NOTE: You should never use this method at page load time. Generally, it is safer to use FB.getLoginStatus() if you are unsure.

For documentation on the AuthResponse object itself, please see FB.getLoginStatus()

Updated about 5 months ago
Facebook © 2012 · English (US)
AboutCareersPlatform PoliciesPrivacy Policy