Skip to content
Tidewater Techs LLC
Services
All services Managed IT Services Cybersecurity & Compliance Technology Strategy & vCIO Networking & Infrastructure Business Communications Video Surveillance Software Development, Web & Hosting
Solutions Industries Clients About Contact

Code Help

Extending DotNetOpenAuth for Facebook login – with email scope

June 27, 2014 · Michael Cole

facebook-app-permission-access

It’s a mixed world of code out there and in this instance .net was the platform. Why make the wheel when there are so many useful tools like DotNetOpenAuth. Simple to setup for Google Authorization, facebook left a little to be desired, and, the tools were all there.

The Frustration: There isn’t just a simple write-up to add scope variables to DotNetOpenAuth for facebook permissions

The Solution: ApplicationBlock. DotNetOpenAuth includes a set of code extensions called ApplicationBlock found under the Samples folder of the package. There are two files for facebook: FacebookClient.cs and FacebookGraph.cs; that handle all the heavy lifting for you.

  1. download the package for your .net version
  2. copy the files into your App_Code directory
  3. copy the sample code from facebook.aspx found under the OAuthClient Samples folder
  4. add the optional parameter when calling the RequestUserAuthorization() command to initially login the user (vb example below)
    Dim scope As New Collections.Generic.List(Of String)
    scope.Add("email")
    facebookClient.RequestUserAuthorization(scope)
    
  5. This forces facebook to request the user to authorize access to their email address – add the fields as necessary to gain access to other data

Here is a more detailed tutorial on installing The ApplicationBlock into your Project.

3324 Virginia Beach Blvd, Suite 102
Virginia Beach, VA 23452

Services

  • Managed IT Services
  • Cybersecurity & Compliance
  • Technology Strategy & vCIO
  • Networking & Infrastructure
  • Business Communications
  • Video Surveillance
  • Software Development, Web & Hosting

Talk

  • 757.301.1789
  • support@tidewatertechs.com
  • New business

Clients

  • Quick Support
  • Client documents
  • Support
© 2026 Tidewater Techs LLC Privacy policy Terms and conditions Credits LinkedIn Facebook