Export (0) Print
Expand All

OAuthWebSecurity Class

Manages security that uses OAuth authentication providers like Facebook, Twitter, LinkedIn, Windows Live and OpenID authentication providers like Google and Yahoo.

System.Object
  Microsoft.Web.WebPages.OAuth.OAuthWebSecurity

Namespace:  Microsoft.Web.WebPages.OAuth
Assembly:  Microsoft.Web.WebPages.OAuth (in Microsoft.Web.WebPages.OAuth.dll)

public static class OAuthWebSecurity

The OAuthWebSecurity type exposes the following members.

  NameDescription
Public propertyStatic memberIsAuthenticatedWithOAuthGets a value that indicates whether the user has been authenticated using OAuth.
Public propertyStatic memberRegisteredClientDataGets a collection of registered client data.
Top

  NameDescription
Public methodStatic memberCreateOrUpdateAccountCreates or updates the account using the specified provider and user ID for the provider ID and associate the new account with the specified user name.
Public methodStatic memberDeleteAccountDeletes the specified membership account.
Public methodStatic memberGetAccountsFromUserNameGets the account or accounts that are associated using the specified user name.
Public methodStatic memberGetOAuthClientDataReturns an OAuth authentication client data with the specified provider.
Public methodStatic memberGetUserNameReturns the user ID for the specified OAuth or OpenID provider and provider user ID.
Public methodStatic memberHasLocalAccountIndicates whether the user has local account.
Public methodStatic memberLoginLogs the user in.
Public methodStatic memberRegisterClient(IAuthenticationClient)Registers an OAuth authentication client.
Public methodStatic memberRegisterClient(IAuthenticationClient, String, IDictionary<String, Object>)Registers an OAuth authentication client.
Public methodStatic memberRegisterFacebookClient(String, String)Registers a Facebook client with a specified identifier.
Public methodStatic memberRegisterFacebookClient(String, String, String)Registers a Facebook client with a specified identifier.
Public methodStatic memberRegisterFacebookClient(String, String, String, IDictionary<String, Object>)Registers a Facebook client with a specified identifier.
Public methodStatic memberRegisterGoogleClient()Registers a Google client.
Public methodStatic memberRegisterGoogleClient(String)Registers a Google client.
Public methodStatic memberRegisterGoogleClient(String, IDictionary<String, Object>)Registers a Google client.
Public methodStatic memberRegisterLinkedInClient(String, String)Registers a LinkedIn client with a specified consumer key.
Public methodStatic memberRegisterLinkedInClient(String, String, String)Registers a LinkedIn client with a specified consumer key.
Public methodStatic memberRegisterLinkedInClient(String, String, String, IDictionary<String, Object>)Registers a LinkedIn client with a specified consumer key.
Public methodStatic memberRegisterMicrosoftClient(String, String)Registers a Microsoft client with the specified identifier.
Public methodStatic memberRegisterMicrosoftClient(String, String, String)Registers a Microsoft client with the specified identifier.
Public methodStatic memberRegisterMicrosoftClient(String, String, String, IDictionary<String, Object>)Registers a Microsoft client with the specified identifier.
Public methodStatic memberRegisterTwitterClient(String, String)Registers a Twitter client using the specified consumer key.
Public methodStatic memberRegisterTwitterClient(String, String, String)Registers a Twitter client using the specified consumer key.
Public methodStatic memberRegisterTwitterClient(String, String, String, IDictionary<String, Object>)Registers a Twitter client using the specified consumer key.
Public methodStatic memberRegisterYahooClient()Registers a Yahoo client.
Public methodStatic memberRegisterYahooClient(String)Registers a Yahoo client.
Public methodStatic memberRegisterYahooClient(String, IDictionary<String, Object>)Registers a Yahoo client.
Public methodStatic memberRequestAuthentication(String)Requests the specified provider to start the authentication by directing users to an external website.
Public methodStatic memberRequestAuthentication(String, String)Requests the specified provider to start the authentication by directing users to an external website, and directs the provider to redirect the user to the specified URL when authentication is successful.
Public methodStatic memberSerializeProviderUserIdSerializes a user ID of the provider.
Public methodStatic memberTryDeserializeProviderUserIdIndicates whether the user ID of the provider deserialized.
Public methodStatic memberTryGetOAuthClientDataIndicates whether the provider gets an OAuth client data.
Public methodStatic memberVerifyAuthentication()Returns a value that indicates whether the user account has been confirmed by the provider.
Public methodStatic memberVerifyAuthentication(String)Returns a value that indicates whether the user account has been confirmed by the provider.
Top

This class simplifies the task of letting users log in to your website using their credentials from another site, like Facebook or Yahoo. You can enable logins from those providers and then manage security in your site in much the same way that you do using the built-in membership provider.

For an example of using the OAuthWebSecurity class, see Using OAuth Providers with MVC 4.

NoteNote

The classes in this namespace interact with the classes from the open-source DotNetOpenAuth library. The DotNetOpenAuth library has its own documentation at http://docs.dotnetopenauth.net/master/.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft