Koste
Koste

Reputation: 538

DotNetOpenAuth AspNet request status_update permission

I am using DotNetOpenAuth.AspNet for Facebook authentication. And everything works well.

However, I have to change app permissions so when a user logins I should request status_update permission. I've changed Permissions in Facebook app configuration, but I didn't get updated Login Window in my application.

enter image description here

Also I tried to handle OAuthWebSecurity.RegisterFacebookClient method call with passing extra data scope attribute, but without any access.

Does someone know how to request additional Facebook permissions using DotNetOpenAuth.AspNet?

EDIT:

When I try to do post I got this error:

(OAuthException - #200) (#200) The user hasn't authorized the application to perform this action

And this is what I get when I try to login to my app:

enter image description here

There is no status_update permission.

Thanks.

Upvotes: 0

Views: 372

Answers (1)

Pete - MSFT
Pete - MSFT

Reputation: 4309

At this point you can't. Deep in the innards of DotNetOpenAuth.AspNet there is a class called FacebookClient. Within class is a method which is called "GetServiceLoginUrl".

This method in version 4.3.0 hardcodes the scope to "email".

If you go to the Nuget prerelease repository however, and get the prelease version 4.3.1 from there, the FacebookClient class comes with an additional parameter in the constructor - scope. You can add the permissions in there, and it will add them to the request url.

The pre-release package source is http://teamcity.dotnetopenauth.net:82/guestAuth/app/nuget/v1/FeedService.svc/

new FacebookClient(appId, secret, new[] {"email","manage_pages"});

and you should be good to go.

Upvotes: 3

Related Questions