How to prompt use to "allow access"

Jan 29, 2010 at 2:41 AM

I am writting my first app in ASP.Net using C#. I have played other apps in face book (farmville, mafia wars) and when I first when to there page I was asked to allow them access to my profile.  I can not figure out how to promp the user of my app do this so I can do the extra things that it allows. Right now it just do the basic authentication which. Facebook talks about doing this at http://wiki.developers.facebook.com/index.php/Authorizing_Applications but it talks about PHP. I have the base.requirelogin = true statment in my Page_PreInit but when I or anyone else goes to my app they are not showed the "allow acess" page. What am I doing wrong?

Jan 29, 2010 at 3:25 AM

You have to pop up a window to the user and direct them to the request permissions page.

 

                Dim permissionsURL As String = "http://www.facebook.com/connect/prompt_permissions.php?api_key={0}&ext_perm={1}&next={2}&cancel={3}&display=wap"
                Dim redirectURL As String = String.Format(permissionsURL, FacebookAppKey, req_Perms, requestPermissionsResponsePath, requestPermissionsCancelPath)

Dim permissionsURL As String = "http://www.facebook.com/connect/prompt_permissions.php?api_key={0}&ext_perm={1}&next={2}&cancel={3}&display=wap"
Dim redirectURL As String = String.Format(permissionsURL, FacebookAppKey, req_Perms, requestPermissionsResponsePath, requestPermissionsCancelPath)

Response.Redirect(redirectURL, False) 

Pass a comma separated list of permissions you need into "req_Perms". 

http://wiki.developers.facebook.com/index.php/Extended_permissions

I've found the best approach is to direct them to the permissions request page as soon as they login.  That way they are already authenticated and the session is valid.  

Part of the confusion is how there are multiple login / permission URL's.  It just depends if your working on a desktop app, web app, mobile, etc. 

 

Jan 29, 2010 at 11:39 AM

Thank you so much I will make that change tonight.

Feb 15, 2010 at 6:37 PM

I am having this same problem.  It seems that this is a new behavior in version 3.  Version 2 would prompt the user to authorize the app.

Thanks for your solution - I will probably have to implement it -- but I am frustrated to have to resort to something so manual.  The FDT should do this!  It used to.  Isn't there a better way?

I can't wait for FDT 4...  nothing will work.