diff --git a/OwinOAuthProviders.sln b/OwinOAuthProviders.sln
index 804f7d7..eb63188 100644
--- a/OwinOAuthProviders.sln
+++ b/OwinOAuthProviders.sln
@@ -104,6 +104,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Owin.Security.Providers.Box
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Owin.Security.Providers.Baidu", "src\Owin.Security.Providers.Baidu\Owin.Security.Providers.Baidu.csproj", "{E2759807-4D7C-4288-AAC8-F5B7B4616680}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Owin.Security.Providers.WSO2", "src\Owin.Security.Providers.WSO2\Owin.Security.Providers.WSO2.csproj", "{8FD3A9CB-E684-42C0-A8BF-7746FDD3D43C}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -314,6 +316,10 @@ Global
{E2759807-4D7C-4288-AAC8-F5B7B4616680}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2759807-4D7C-4288-AAC8-F5B7B4616680}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2759807-4D7C-4288-AAC8-F5B7B4616680}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8FD3A9CB-E684-42C0-A8BF-7746FDD3D43C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8FD3A9CB-E684-42C0-A8BF-7746FDD3D43C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8FD3A9CB-E684-42C0-A8BF-7746FDD3D43C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8FD3A9CB-E684-42C0-A8BF-7746FDD3D43C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/OwinOAuthProvidersDemo/App_Start/Startup.Auth.cs b/OwinOAuthProvidersDemo/App_Start/Startup.Auth.cs
index f2d68ae..f209dd4 100755
--- a/OwinOAuthProvidersDemo/App_Start/Startup.Auth.cs
+++ b/OwinOAuthProvidersDemo/App_Start/Startup.Auth.cs
@@ -18,274 +18,277 @@ namespace OwinOAuthProvidersDemo
});
// Use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
- //app.UseDeviantArtAuthentication("id", "secret");
- //app.UseUntappdAuthentication("id", "secret");
- // Uncomment the following lines to enable logging in with third party login providers
- //app.UseMicrosoftAccountAuthentication(
- // clientId: "",
- // clientSecret: "");
+ //app.UseDeviantArtAuthentication("id", "secret");
+ //app.UseUntappdAuthentication("id", "secret");
+ // Uncomment the following lines to enable logging in with third party login providers
+ //app.UseMicrosoftAccountAuthentication(
+ // clientId: "",
+ // clientSecret: "");
- //app.UseTwitterAuthentication(
- // consumerKey: "",
- // consumerSecret: "");
+ //app.UseTwitterAuthentication(
+ // consumerKey: "",
+ // consumerSecret: "");
- //app.UseFacebookAuthentication(
- // appId: "",
- // appSecret: "");
+ //app.UseFacebookAuthentication(
+ // appId: "",
+ // appSecret: "");
- //app.UseGoogleAuthentication();
+ //app.UseGoogleAuthentication();
- //app.UseLinkedInAuthentication("", "");
+ //app.UseLinkedInAuthentication("", "");
- //app.UseYahooAuthentication("", "");
+ //app.UseYahooAuthentication("", "");
- //app.UseTripItAuthentication("", "");
+ //app.UseTripItAuthentication("", "");
- //app.UseGitHubAuthentication("", "");
+ //app.UseGitHubAuthentication("", "");
- //app.UseBufferAuthentication("", "");
+ //app.UseBufferAuthentication("", "");
- //app.UseRedditAuthentication("", "");
+ //app.UseRedditAuthentication("", "");
- //app.UseStackExchangeAuthentication(
- // clientId: "",
- // clientSecret: "",
- // key: "");
+ //app.UseStackExchangeAuthentication(
+ // clientId: "",
+ // clientSecret: "",
+ // key: "");
- //app.UseInstagramInAuthentication("", "");
+ //app.UseInstagramInAuthentication("", "");
- //var options = new GooglePlusAuthenticationOptions
- //{
- // ClientId = "",
- // ClientSecret = "",
- // RequestOfflineAccess = true,
- // Provider = new GooglePlusAuthenticationProvider
- // {
- // OnAuthenticated = async context => System.Diagnostics.Debug.WriteLine(String.Format("Refresh Token: {0}", context.RefreshToken))
- // }
- //};
- //options.MomentTypes.Add("http://schemas.google.com/AddActivity");
- //options.MomentTypes.Add("http://schemas.google.com/CheckInActivity");
- //options.MomentTypes.Add("http://schemas.google.com/BuyActivity");
- //app.UseGooglePlusAuthentication(options);
+ //var options = new GooglePlusAuthenticationOptions
+ //{
+ // ClientId = "",
+ // ClientSecret = "",
+ // RequestOfflineAccess = true,
+ // Provider = new GooglePlusAuthenticationProvider
+ // {
+ // OnAuthenticated = async context => System.Diagnostics.Debug.WriteLine(String.Format("Refresh Token: {0}", context.RefreshToken))
+ // }
+ //};
+ //options.MomentTypes.Add("http://schemas.google.com/AddActivity");
+ //options.MomentTypes.Add("http://schemas.google.com/CheckInActivity");
+ //options.MomentTypes.Add("http://schemas.google.com/BuyActivity");
+ //app.UseGooglePlusAuthentication(options);
- /*
+ /*
* Twitch sign-ins use /signin-Twitch as the URL for authentication
*
*/
- ////Simple Twitch Sign-in
- //app.UseTwitchAuthentication("", "");
+ ////Simple Twitch Sign-in
+ //app.UseTwitchAuthentication("", "");
- ////More complex Twitch Sign-in
- //var opt = new TwitchAuthenticationOptions()
- //{
- // ClientId = "",
- // ClientSecret = "",
- // Provider = new TwitchAuthenticationProvider()
- // {
- // OnAuthenticated = async z =>
- // {
- //// Getting the twitch users picture
- // z.Identity.AddClaim(new Claim("Picture", z.User.GetValue("logo").ToString()));
- // }
- //// You should be able to access these claims with HttpContext.GetOwinContext().Authentication.GetExternalLoginInfoAsync().Claims in your Account Controller
- // // Commonly used in the ExternalLoginCallback() in AccountController.cs
- // /*
+ ////More complex Twitch Sign-in
+ //var opt = new TwitchAuthenticationOptions()
+ //{
+ // ClientId = "",
+ // ClientSecret = "",
+ // Provider = new TwitchAuthenticationProvider()
+ // {
+ // OnAuthenticated = async z =>
+ // {
+ //// Getting the twitch users picture
+ // z.Identity.AddClaim(new Claim("Picture", z.User.GetValue("logo").ToString()));
+ // }
+ //// You should be able to access these claims with HttpContext.GetOwinContext().Authentication.GetExternalLoginInfoAsync().Claims in your Account Controller
+ // // Commonly used in the ExternalLoginCallback() in AccountController.cs
+ // /*
- // if (user != null)
- // {
- // var claim = (await AuthenticationManager.GetExternalLoginInfoAsync()).ExternalIdentity.Claims.First(
- // a => a.Type == "Picture");
- // user.Claims.Add(new IdentityUserClaim() { ClaimType = claim.Type, ClaimValue = claim.Value });
- // await SignInAsync(user, isPersistent: false);
- // return RedirectToLocal(returnUrl);
- // }
- // */
- // }
- //};
- //app.UseTwitchAuthentication(opt);
+ // if (user != null)
+ // {
+ // var claim = (await AuthenticationManager.GetExternalLoginInfoAsync()).ExternalIdentity.Claims.First(
+ // a => a.Type == "Picture");
+ // user.Claims.Add(new IdentityUserClaim() { ClaimType = claim.Type, ClaimValue = claim.Value });
+ // await SignInAsync(user, isPersistent: false);
+ // return RedirectToLocal(returnUrl);
+ // }
+ // */
+ // }
+ //};
+ //app.UseTwitchAuthentication(opt);
- //app.UseOpenIDAuthentication("http://me.yahoo.com/", "Yahoo");
+ //app.UseOpenIDAuthentication("http://me.yahoo.com/", "Yahoo");
- //app.UseOpenIDAuthentication("https://openid.stackexchange.com/", "StackExchange");
+ //app.UseOpenIDAuthentication("https://openid.stackexchange.com/", "StackExchange");
- //app.UseOpenIDAuthentication("https://www.google.com/accounts/o8/id", "Google");
+ //app.UseOpenIDAuthentication("https://www.google.com/accounts/o8/id", "Google");
- //app.UseSteamAuthentication(applicationKey: "");
+ //app.UseSteamAuthentication(applicationKey: "");
- //app.UseOpenIDAuthentication("http://orange.fr", "Orange");
- // Use OpenId provider login uri instead of discovery uri
- //app.UseOpenIDAuthentication("http://openid.orange.fr/server", "Orange", true);
+ //app.UseOpenIDAuthentication("http://orange.fr", "Orange");
+ // Use OpenId provider login uri instead of discovery uri
+ //app.UseOpenIDAuthentication("http://openid.orange.fr/server", "Orange", true);
- //app.UseSalesforceAuthentication(
- // clientId: "",
- // clientSecret: "");
+ //app.UseSalesforceAuthentication(
+ // clientId: "",
+ // clientSecret: "");
- //in scenarios where a sandbox URL needs to be used
- //var salesforceOptions = new SalesforceAuthenticationOptions
- //{
- // Endpoints =
- // new SalesforceAuthenticationOptions.SalesforceAuthenticationEndpoints
- // {
- // AuthorizationEndpoint =
- // "https://ap1.salesforce.com/services/oauth2/authorize",
- // TokenEndpoint = "https://ap1.salesforce.com/services/oauth2/token"
- // },
- // ClientId = "",
- // ClientSecret = "",
- // Provider = new SalesforceAuthenticationProvider()
- // {
- // OnAuthenticated = async context =>
- // {
- // System.Diagnostics.Debug.WriteLine(context.AccessToken);
- // System.Diagnostics.Debug.WriteLine(context.RefreshToken);
- // System.Diagnostics.Debug.WriteLine(context.OrganizationId);
- // }
- // }
- //};
- //app.UseSalesforceAuthentication(salesforceOptions);
+ //in scenarios where a sandbox URL needs to be used
+ //var salesforceOptions = new SalesforceAuthenticationOptions
+ //{
+ // Endpoints =
+ // new SalesforceAuthenticationOptions.SalesforceAuthenticationEndpoints
+ // {
+ // AuthorizationEndpoint =
+ // "https://ap1.salesforce.com/services/oauth2/authorize",
+ // TokenEndpoint = "https://ap1.salesforce.com/services/oauth2/token"
+ // },
+ // ClientId = "",
+ // ClientSecret = "",
+ // Provider = new SalesforceAuthenticationProvider()
+ // {
+ // OnAuthenticated = async context =>
+ // {
+ // System.Diagnostics.Debug.WriteLine(context.AccessToken);
+ // System.Diagnostics.Debug.WriteLine(context.RefreshToken);
+ // System.Diagnostics.Debug.WriteLine(context.OrganizationId);
+ // }
+ // }
+ //};
+ //app.UseSalesforceAuthentication(salesforceOptions);
- ////app.UseShopifyAuthentication("", "");
+ ////app.UseShopifyAuthentication("", "");
- //app.UseArcGISOnlineAuthentication(
- // clientId: "",
- // clientSecret: "");
+ //app.UseArcGISOnlineAuthentication(
+ // clientId: "",
+ // clientSecret: "");
- //app.UseWordPressAuthentication(
- // clientId: "",
- // clientSecret: "");
+ //app.UseWordPressAuthentication(
+ // clientId: "",
+ // clientSecret: "");
- //app.UseDropboxAuthentication(
- // appKey: "",
- // appSecret: "");
+ //app.UseDropboxAuthentication(
+ // appKey: "",
+ // appSecret: "");
- //app.UseHealthGraphAuthentication(
- // clientId: "",
- // clientSecret: "");
+ //app.UseHealthGraphAuthentication(
+ // clientId: "",
+ // clientSecret: "");
- //app.UseBoxAuthentication(
- // appKey: "",
- // appSecret: "");
+ //app.UseBoxAuthentication(
+ // appKey: "",
+ // appSecret: "");
- //app.UseBaiduAuthentication(
- // apiKey: "",
- // secretKey: "");
+ //app.UseBaiduAuthentication(
+ // apiKey: "",
+ // secretKey: "");
- //app.UseBattleNetAuthentication(new BattleNetAuthenticationOptions
- //{
- // ClientId = "",
- // ClientSecret = ""
- //});
- //app.UseBattleNetAuthentication(
- // clientId: "",
- // clientSecret: "");
+ //app.UseBattleNetAuthentication(new BattleNetAuthenticationOptions
+ //{
+ // ClientId = "",
+ // ClientSecret = ""
+ //});
+ //app.UseBattleNetAuthentication(
+ // clientId: "",
+ // clientSecret: "");
- //app.UseAsanaAuthentication("", "");
+ //app.UseAsanaAuthentication("", "");
- //app.UseEveOnlineAuthentication("", "");
+ //app.UseEveOnlineAuthentication("", "");
- //app.UseSoundCloudAuthentication("", "");
+ //app.UseSoundCloudAuthentication("", "");
- //app.UseFoursquareAuthentication(
- // clientId: "",
- // clientSecret: "");
+ //app.UseFoursquareAuthentication(
+ // clientId: "",
+ // clientSecret: "");
- //app.UsePayPalAuthentication(
- // clientId: "",
- // clientSecret: "",
- // isSandbox: false);
+ //app.UsePayPalAuthentication(
+ // clientId: "",
+ // clientSecret: "",
+ // isSandbox: false);
- //app.UseWargamingAccountAuthentication("", WargamingAuthenticationOptions.Region.NorthAmerica);
+ //app.UseWargamingAccountAuthentication("", WargamingAuthenticationOptions.Region.NorthAmerica);
- //app.UseFlickrAuthentication("", "");
- //app.UseVisualStudioAuthentication(
- // appId: "",
- // appSecret: "");
+ //app.UseFlickrAuthentication("", "");
+ //app.UseVisualStudioAuthentication(
+ // appId: "",
+ // appSecret: "");
- //app.UseSpotifyAuthentication(
- // clientId: "",
- // clientSecret: "");
+ //app.UseSpotifyAuthentication(
+ // clientId: "",
+ // clientSecret: "");
- //var options = new SlackAuthenticationOptions
- //{
- // ClientId = "",
- // ClientSecret = "",
- // TeamId = "" // optional
- //};
- //options.Scope.Add("identify");
- //app.UseSlackAuthentication(options);
+ //var options = new SlackAuthenticationOptions
+ //{
+ // ClientId = "",
+ // ClientSecret = "",
+ // TeamId = "" // optional
+ //};
+ //options.Scope.Add("identify");
+ //app.UseSlackAuthentication(options);
- //app.UseGitterAuthentication(
- // clientId: "",
- // clientSecret: ""
- //);
+ //app.UseGitterAuthentication(
+ // clientId: "",
+ // clientSecret: ""
+ //);
- //app.UseImgurAuthentication(
- // new ImgurAuthenticationOptions
- // {
- // ClientId = "",
- // ClientSecret = ""
- // });
+ //app.UseImgurAuthentication(
+ // new ImgurAuthenticationOptions
+ // {
+ // ClientId = "",
+ // ClientSecret = ""
+ // });
- //var options = new BacklogAuthenticationOptions
- //{
- // ClientId = "",
- // ClientSecret = "",
- // ContractName = "",
- // CallbackPath = new PathString(""), // ex.new PathString("/OauthTokenRequest")
- // Provider = new BacklogAuthenticationProvider
- // {
- // OnAuthenticated = async context => await System.Threading.Tasks.Task.Run(()=> { System.Diagnostics.Debug.WriteLine(String.Format("Refresh Token: {0}", context.RefreshToken)); })
- // }
- //};
+ //var options = new BacklogAuthenticationOptions
+ //{
+ // ClientId = "",
+ // ClientSecret = "",
+ // ContractName = "",
+ // CallbackPath = new PathString(""), // ex.new PathString("/OauthTokenRequest")
+ // Provider = new BacklogAuthenticationProvider
+ // {
+ // OnAuthenticated = async context => await System.Threading.Tasks.Task.Run(()=> { System.Diagnostics.Debug.WriteLine(String.Format("Refresh Token: {0}", context.RefreshToken)); })
+ // }
+ //};
- //app.UseBacklogAuthentication(options);
+ //app.UseBacklogAuthentication(options);
- //var cosignOptions = new CosignAuthenticationOptions
- //{
- // AuthenticationType = "Cosign",
- // SignInAsAuthenticationType = signInAsType,
- // CosignServer = "weblogin.umich.edu",
- // CosignServicePort = 6663,
- // IdentityServerHostInstance = "core1",
- // ClientServer = "cosignservername"
- //};
- //app.UseCosignAuthentication(cosignOptions);
+ //var cosignOptions = new CosignAuthenticationOptions
+ //{
+ // AuthenticationType = "Cosign",
+ // SignInAsAuthenticationType = signInAsType,
+ // CosignServer = "weblogin.umich.edu",
+ // CosignServicePort = 6663,
+ // IdentityServerHostInstance = "core1",
+ // ClientServer = "cosignservername"
+ //};
+ //app.UseCosignAuthentication(cosignOptions);
- //app.UseVimeoAuthentication("", "");
+ //app.UseVimeoAuthentication("", "");
- //app.UseFitbitAuthentication(new FitbitAuthenticationOptions
- //{
- // ClientId = "",
- // ClientSecret = ""
- //});
+ //app.UseFitbitAuthentication(new FitbitAuthenticationOptions
+ //{
+ // ClientId = "",
+ // ClientSecret = ""
+ //});
- //app.UseOnshapeAuthentication(
- // appKey: "",
- // appSecret: "");
- //
- //
- //app.UseOnshapeAuthentication(new OnshapeAuthenticationOptions()
- //{
- // AppKey = "",
- // AppSecret = "",
- // CallbackPath = new PathString("/oauthRedirect"),
- // Hostname = "partner.dev.onshape.com"
- //});
+ //app.UseOnshapeAuthentication(
+ // appKey: "",
+ // appSecret: "");
+ //
+ //
+ //app.UseOnshapeAuthentication(new OnshapeAuthenticationOptions()
+ //{
+ // AppKey = "",
+ // AppSecret = "",
+ // CallbackPath = new PathString("/oauthRedirect"),
+ // Hostname = "partner.dev.onshape.com"
+ //});
- //app.UseVKontakteAuthentication("", "");
+ //app.UseVKontakteAuthentication("", "");
- //app.UseXingAuthentication("", "");
+ //app.UseXingAuthentication("", "");
- //app.UseDoYouBuzzAuthentication("", "");
- //app.("", "");
- //app.UseOrcidAuthentication("","");
+ //app.UseDoYouBuzzAuthentication("", "");
+ //app.("", "");
+ //app.UseOrcidAuthentication("","");
- //app.UseDiscordAuthentication("", "");
- //app.UseGeniAuthentication("", "");
- //app.UseMyHeritageAuthentication("", "");
- }
- }
+ //app.UseDiscordAuthentication("", "");
+ //app.UseGeniAuthentication("", "");
+ //app.UseMyHeritageAuthentication("", "");
+
+ //app.UseWSO2Authentication("", "", "");
+
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Owin.Security.Providers.WSO2/Constants.cs b/src/Owin.Security.Providers.WSO2/Constants.cs
new file mode 100644
index 0000000..3873ee2
--- /dev/null
+++ b/src/Owin.Security.Providers.WSO2/Constants.cs
@@ -0,0 +1,8 @@
+namespace Owin.Security.Providers.WSO2
+{
+ internal static class Constants
+ {
+ public const string DefaultAuthenticationType = "WSO2";
+
+ }
+}
diff --git a/src/Owin.Security.Providers.WSO2/Owin.Security.Providers.WSO2.csproj b/src/Owin.Security.Providers.WSO2/Owin.Security.Providers.WSO2.csproj
new file mode 100644
index 0000000..60281d9
--- /dev/null
+++ b/src/Owin.Security.Providers.WSO2/Owin.Security.Providers.WSO2.csproj
@@ -0,0 +1,92 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {8FD3A9CB-E684-42C0-A8BF-7746FDD3D43C}
+ Library
+ Properties
+ OWin.Security.Providers.WSO2
+ OWin.Security.Providers.WSO2
+ v4.5
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll
+ True
+
+
+ ..\..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll
+ True
+
+
+ ..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+ ..\..\packages\Owin.1.0\lib\net40\Owin.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(PostBuildEventDependsOn);
+ PostBuildMacros;
+
+
+
\ No newline at end of file
diff --git a/src/Owin.Security.Providers.WSO2/Properties/AssemblyInfo.cs b/src/Owin.Security.Providers.WSO2/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..1f1b4c3
--- /dev/null
+++ b/src/Owin.Security.Providers.WSO2/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the follOwing
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Owin.Security.Providers.WSO2")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Owin.Security.Providers.WSO2")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The follOwing GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("8fd3a9cb-e684-42c0-a8bf-7746fdd3d43c")]
+
+// Version information for an assembly consists of the follOwing four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/Owin.Security.Providers.WSO2/Provider/IWSO2AuthenticationProvider.cs b/src/Owin.Security.Providers.WSO2/Provider/IWSO2AuthenticationProvider.cs
new file mode 100644
index 0000000..8d359f8
--- /dev/null
+++ b/src/Owin.Security.Providers.WSO2/Provider/IWSO2AuthenticationProvider.cs
@@ -0,0 +1,17 @@
+using System.Threading.Tasks;
+
+namespace Owin.Security.Providers.WSO2
+{
+ public interface IWSO2AuthenticationProvider
+ {
+ Task Authenticated(WSO2AuthenticatedContext context);
+
+ Task ReturnEndpoint(WSO2ReturnEndpointContext context);
+
+ ///
+ /// Called when a Challenge causes a redirect to authorize endpoint in the wso2 middleware
+ ///
+ /// Contains redirect URI and of the challenge
+ void ApplyRedirect(WSO2ApplyRedirectContext context);
+ }
+}
\ No newline at end of file
diff --git a/src/Owin.Security.Providers.WSO2/Provider/WSO2ApplyRedirectContext.cs b/src/Owin.Security.Providers.WSO2/Provider/WSO2ApplyRedirectContext.cs
new file mode 100644
index 0000000..5be933e
--- /dev/null
+++ b/src/Owin.Security.Providers.WSO2/Provider/WSO2ApplyRedirectContext.cs
@@ -0,0 +1,39 @@
+using Microsoft.Owin;
+using Microsoft.Owin.Security;
+using Microsoft.Owin.Security.Provider;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Owin.Security.Providers.WSO2
+{
+ public class WSO2ApplyRedirectContext : BaseContext
+ {
+ ///
+ /// Creates a new context object.
+ ///
+ /// The Owin request context
+ /// The wso2 middleware options
+ /// The authenticaiton properties of the challenge
+ /// The initial redirect URI
+ public WSO2ApplyRedirectContext(IOwinContext context, WSO2AuthenticationOptions options,
+ AuthenticationProperties properties, string redirectUri)
+ : base(context, options)
+ {
+ RedirectUri = redirectUri;
+ Properties = properties;
+ }
+
+ ///
+ /// Gets the URI used for the redirect operation.
+ ///
+ public string RedirectUri { get; private set; }
+
+ ///
+ /// Gets the authentication properties of the challenge
+ ///
+ public AuthenticationProperties Properties { get; private set; }
+ }
+}
diff --git a/src/Owin.Security.Providers.WSO2/Provider/WSO2AuthenticatedContext.cs b/src/Owin.Security.Providers.WSO2/Provider/WSO2AuthenticatedContext.cs
new file mode 100644
index 0000000..9461cd5
--- /dev/null
+++ b/src/Owin.Security.Providers.WSO2/Provider/WSO2AuthenticatedContext.cs
@@ -0,0 +1,48 @@
+using Microsoft.Owin.Security.Provider;
+using System.Security.Claims;
+using Microsoft.Owin;
+using Newtonsoft.Json.Linq;
+using Microsoft.Owin.Security;
+
+namespace Owin.Security.Providers.WSO2
+{
+ public class WSO2AuthenticatedContext : BaseContext
+ {
+ public WSO2AuthenticatedContext(IOwinContext context, JObject user, string accessToken)
+ : base(context)
+ {
+ User = user;
+ AccessToken = accessToken;
+
+ Id = TryGetValue(user, "sub");
+ }
+
+ ///
+ /// Gets the WSO2 user
+ ///
+ public JObject User { get; private set; }
+
+ public string Id { get; private set;}
+
+ ///
+ /// Gets the access token
+ ///
+ public string AccessToken { 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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Owin.Security.Providers.WSO2/Provider/WSO2AuthenticationProvider.cs b/src/Owin.Security.Providers.WSO2/Provider/WSO2AuthenticationProvider.cs
new file mode 100644
index 0000000..c014d8d
--- /dev/null
+++ b/src/Owin.Security.Providers.WSO2/Provider/WSO2AuthenticationProvider.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Owin.Security.Providers.WSO2
+{
+ public class WSO2AuthenticationProvider : IWSO2AuthenticationProvider
+ {
+ public WSO2AuthenticationProvider()
+ {
+ OnAuthenticated = context => Task.FromResult