diff options
Diffstat (limited to 'src/DotNetOpenAuth.Web/Clients/IAuthenticationClient.cs')
-rw-r--r-- | src/DotNetOpenAuth.Web/Clients/IAuthenticationClient.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Web/Clients/IAuthenticationClient.cs b/src/DotNetOpenAuth.Web/Clients/IAuthenticationClient.cs new file mode 100644 index 0000000..526d775 --- /dev/null +++ b/src/DotNetOpenAuth.Web/Clients/IAuthenticationClient.cs @@ -0,0 +1,33 @@ +using System; +using System.Web; + +namespace DotNetOpenAuth.Web.Clients +{ + /// <summary> + /// Represents a client which can authenticate users via an external website/provider. + /// </summary> + public interface IAuthenticationClient + { + /// <summary> + /// Gets the name of the provider which provides authentication service. + /// </summary> + string ProviderName { get; } + + /// <summary> + /// Attempts to authenticate users by forwarding them to an external website, and + /// upon succcess or failure, redirect users back to the specified url. + /// </summary> + /// <param name="context">The context of the current request.</param> + /// <param name="returnUrl">The return url after users have completed authenticating against external website.</param> + void RequestAuthentication(HttpContextBase context, Uri returnUrl); + + /// <summary> + /// Check if authentication succeeded after user is redirected back from the service provider. + /// </summary> + /// <param name="context">The context of the current request.</param> + /// <returns> + /// An instance of <see cref="AuthenticationResult"/> containing authentication result. + /// </returns> + AuthenticationResult VerifyAuthentication(HttpContextBase context); + } +} |