diff --git a/Owin.Security.Providers/Owin.Security.Providers.csproj b/Owin.Security.Providers/Owin.Security.Providers.csproj
index 74cfa76..1782424 100644
--- a/Owin.Security.Providers/Owin.Security.Providers.csproj
+++ b/Owin.Security.Providers/Owin.Security.Providers.csproj
@@ -179,6 +179,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/Owin.Security.Providers/Owin.Security.Providers.csproj.DotSettings b/Owin.Security.Providers/Owin.Security.Providers.csproj.DotSettings
index ff86f88..1882ca9 100644
--- a/Owin.Security.Providers/Owin.Security.Providers.csproj.DotSettings
+++ b/Owin.Security.Providers/Owin.Security.Providers.csproj.DotSettings
@@ -1,3 +1,4 @@
True
- True
\ No newline at end of file
+ True
+ True
\ No newline at end of file
diff --git a/Owin.Security.Providers/WordPress/Constants.cs b/Owin.Security.Providers/WordPress/Constants.cs
new file mode 100644
index 0000000..21d849c
--- /dev/null
+++ b/Owin.Security.Providers/WordPress/Constants.cs
@@ -0,0 +1,7 @@
+namespace Owin.Security.Providers.WordPress
+{
+ internal static class Constants
+ {
+ public const string DefaultAuthenticationType = "WordPress";
+ }
+}
\ No newline at end of file
diff --git a/Owin.Security.Providers/WordPress/Provider/IWordPressAuthenticationProvider.cs b/Owin.Security.Providers/WordPress/Provider/IWordPressAuthenticationProvider.cs
new file mode 100644
index 0000000..d04ae07
--- /dev/null
+++ b/Owin.Security.Providers/WordPress/Provider/IWordPressAuthenticationProvider.cs
@@ -0,0 +1,24 @@
+using System.Threading.Tasks;
+
+namespace Owin.Security.Providers.WordPress
+{
+ ///
+ /// Specifies callback methods which the invokes to enable developer control over the authentication process. />
+ ///
+ public interface IWordPressAuthenticationProvider
+ {
+ ///
+ /// Invoked whenever WordPress succesfully authenticates a user
+ ///
+ /// Contains information about the login session as well as the user .
+ /// A representing the completed operation.
+ Task Authenticated(WordPressAuthenticatedContext context);
+
+ ///
+ /// Invoked prior to the being saved in a local cookie and the browser being redirected to the originally requested URL.
+ ///
+ ///
+ /// A representing the completed operation.
+ Task ReturnEndpoint(WordPressReturnEndpointContext context);
+ }
+}
\ No newline at end of file
diff --git a/Owin.Security.Providers/WordPress/Provider/WordPressAuthenticatedContext.cs b/Owin.Security.Providers/WordPress/Provider/WordPressAuthenticatedContext.cs
new file mode 100644
index 0000000..58bfbe4
--- /dev/null
+++ b/Owin.Security.Providers/WordPress/Provider/WordPressAuthenticatedContext.cs
@@ -0,0 +1,90 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+using System;
+using System.Globalization;
+using System.Security.Claims;
+using Microsoft.Owin;
+using Microsoft.Owin.Security;
+using Microsoft.Owin.Security.Provider;
+using Newtonsoft.Json.Linq;
+
+namespace Owin.Security.Providers.WordPress
+{
+ ///
+ /// Contains information about the login session as well as the user .
+ ///
+ public class WordPressAuthenticatedContext : BaseContext
+ {
+ ///
+ /// Initializes a
+ ///
+ /// The OWIN environment
+ /// The JSON-serialized user
+ /// WordPress Access token
+ /// Seconds until expiration
+ public WordPressAuthenticatedContext(IOwinContext context, JObject user, string accessToken, string expires)
+ : base(context)
+ {
+ User = user;
+ Id = TryGetValue(user, "ID");
+ Name = TryGetValue(user, "display_name");
+ Email = TryGetValue(user, "email");
+ AccessToken = accessToken;
+
+ int expiresValue;
+ if (Int32.TryParse(expires, NumberStyles.Integer, CultureInfo.InvariantCulture, out expiresValue))
+ {
+ ExpiresIn = TimeSpan.FromSeconds(expiresValue);
+ }
+ }
+
+ ///
+ /// The email address of the user
+ ///
+ public string Email { get; set; }
+
+ ///
+ /// Gets the JSON-serialized user
+ ///
+ ///
+ /// Contains the WordPress user obtained from the endpoint https://public-api.wordpress.com/rest/v1/me
+ ///
+ public JObject User { get; private set; }
+
+ ///
+ /// Gets the WordPress OAuth access token
+ ///
+ public string AccessToken { get; private set; }
+
+ ///
+ /// Gets the WordPress access token expiration time
+ ///
+ public TimeSpan? ExpiresIn { get; set; }
+
+ ///
+ /// Gets the WordPress user ID
+ ///
+ public string Id { get; private set; }
+
+ ///
+ /// The name of the user
+ ///
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the representing the user
+ ///
+ public ClaimsIdentity Identity { get; set; }
+
+ ///
+ /// Gets or sets a property bag for common authentication properties
+ ///
+ public AuthenticationProperties Properties { get; set; }
+
+ private static string TryGetValue(JObject user, string propertyName)
+ {
+ JToken value;
+ return user.TryGetValue(propertyName, out value) ? value.ToString() : null;
+ }
+ }
+}
diff --git a/Owin.Security.Providers/WordPress/Provider/WordPressAuthenticationProvider.cs b/Owin.Security.Providers/WordPress/Provider/WordPressAuthenticationProvider.cs
new file mode 100644
index 0000000..175f861
--- /dev/null
+++ b/Owin.Security.Providers/WordPress/Provider/WordPressAuthenticationProvider.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Owin.Security.Providers.WordPress
+{
+ ///
+ /// Default implementation.
+ ///
+ public class WordPressAuthenticationProvider : IWordPressAuthenticationProvider
+ {
+ ///
+ /// Initializes a
+ ///
+ public WordPressAuthenticationProvider()
+ {
+ OnAuthenticated = context => Task.FromResult