OAuthWebSecurity Class
Manages security that uses OAuth authentication providers like Facebook, Twitter, LinkedIn, Windows Live and OpenID authentication providers like Google and Yahoo.
Inheritance Hierarchy
System.Object
Microsoft.Web.WebPages.OAuth.OAuthWebSecurity
Namespace: Microsoft.Web.WebPages.OAuth
Assembly: Microsoft.Web.WebPages.OAuth (in Microsoft.Web.WebPages.OAuth.dll)
Syntax
'Declaration
Public NotInheritable Class OAuthWebSecurity
'Usage
public static class OAuthWebSecurity
public ref class OAuthWebSecurity abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type OAuthWebSecurity = class end
public final class OAuthWebSecurity
The OAuthWebSecurity type exposes the following members.
Properties
Name | Description | |
---|---|---|
IsAuthenticatedWithOAuth | Gets a value that indicates whether the user has been authenticated using OAuth. | |
RegisteredClientData | Gets a collection of registered client data. |
Top
Methods
Name | Description | |
---|---|---|
CreateOrUpdateAccount | Creates 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. | |
DeleteAccount | Deletes the specified membership account. | |
GetAccountsFromUserName | Gets the account or accounts that are associated using the specified user name. | |
GetOAuthClientData | Returns an OAuth authentication client data with the specified provider. | |
GetUserName | Returns the user ID for the specified OAuth or OpenID provider and provider user ID. | |
HasLocalAccount | Indicates whether the user has local account. | |
Login | Logs the user in. | |
RegisterClient(IAuthenticationClient) | Registers an OAuth authentication client. | |
RegisterClient(IAuthenticationClient, String, IDictionary<String, Object>) | Registers an OAuth authentication client. | |
RegisterFacebookClient(String, String) | Registers a Facebook client with a specified identifier. | |
RegisterFacebookClient(String, String, String) | Registers a Facebook client with a specified identifier. | |
RegisterFacebookClient(String, String, String, IDictionary<String, Object>) | Registers a Facebook client with a specified identifier. | |
RegisterGoogleClient() | Registers a Google client. | |
RegisterGoogleClient(String) | Registers a Google client. | |
RegisterGoogleClient(String, IDictionary<String, Object>) | Registers a Google client. | |
RegisterLinkedInClient(String, String) | Registers a LinkedIn client with a specified consumer key. | |
RegisterLinkedInClient(String, String, String) | Registers a LinkedIn client with a specified consumer key. | |
RegisterLinkedInClient(String, String, String, IDictionary<String, Object>) | Registers a LinkedIn client with a specified consumer key. | |
RegisterMicrosoftClient(String, String) | Registers a Microsoft client with the specified identifier. | |
RegisterMicrosoftClient(String, String, String) | Registers a Microsoft client with the specified identifier. | |
RegisterMicrosoftClient(String, String, String, IDictionary<String, Object>) | Registers a Microsoft client with the specified identifier. | |
RegisterTwitterClient(String, String) | Registers a Twitter client using the specified consumer key. | |
RegisterTwitterClient(String, String, String) | Registers a Twitter client using the specified consumer key. | |
RegisterTwitterClient(String, String, String, IDictionary<String, Object>) | Registers a Twitter client using the specified consumer key. | |
RegisterYahooClient() | Registers a Yahoo client. | |
RegisterYahooClient(String) | Registers a Yahoo client. | |
RegisterYahooClient(String, IDictionary<String, Object>) | Registers a Yahoo client. | |
RequestAuthentication(String) | Requests the specified provider to start the authentication by directing users to an external website. | |
RequestAuthentication(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. | |
SerializeProviderUserId | Serializes a user ID of the provider. | |
TryDeserializeProviderUserId | Indicates whether the user ID of the provider deserialized. | |
TryGetOAuthClientData | Indicates whether the provider gets an OAuth client data. | |
VerifyAuthentication() | Returns a value that indicates whether the user account has been confirmed by the provider. | |
VerifyAuthentication(String) | Returns a value that indicates whether the user account has been confirmed by the provider. |
Top
Remarks
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.
Note
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/.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.