-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I added an auth provider for the Podbean API. (#218)
* Added the podbean auth provider. * Updated Readme to include podbean * Fixed Owin nuget reference * Removed regions from around using statements, corrected the VS version in the solution file and changed the Startup.Auth in the demo project to use spaces instead of tabs. * Added the OAuth refresh token to the PodbeanAuthenticatedContext.
- Loading branch information
1 parent
b351a6b
commit 43ee292
Showing
18 changed files
with
1,073 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Owin.Security.Providers.Podbean | ||
{ | ||
internal static class Constants | ||
{ | ||
public const string DefaultAuthenticationType = "Podbean"; | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
src/Owin.Security.Providers.Podbean/Owin.Security.Providers.Podbean.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{A7B95FD4-08AD-499F-B574-07560CC2A63F}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Owin.Security.Providers.Podbean</RootNamespace> | ||
<AssemblyName>Owin.Security.Providers.Podbean</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.Owin.Security, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<HintPath>..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL"> | ||
<HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Net.Http.WebRequest" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="PodbeanAuthenticationExtensions.cs" /> | ||
<Compile Include="PodbeanAuthenticationHandler.cs" /> | ||
<Compile Include="PodbeanAuthenticationMiddleware.cs" /> | ||
<Compile Include="PodbeanAuthenticationOptions.cs" /> | ||
<Compile Include="Constants.cs" /> | ||
<Compile Include="Provider\PodbeanAuthenticatedContext.cs" /> | ||
<Compile Include="Provider\PodbeanAuthenticationProvider.cs" /> | ||
<Compile Include="Provider\PodbeanReturnEndpointContext.cs" /> | ||
<Compile Include="Provider\IPodbeanAuthenticationProvider.cs" /> | ||
<Compile Include="Resources.Designer.cs"> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
<AutoGen>True</AutoGen> | ||
<DesignTime>True</DesignTime> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Include="Resources.resx"> | ||
<Generator>ResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Target Name="PostBuildMacros"> | ||
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)"> | ||
<Output TaskParameter="Assemblies" ItemName="Targets" /> | ||
</GetAssemblyIdentity> | ||
<ItemGroup> | ||
<VersionNumber Include="@(Targets->'%(Version)')" /> | ||
</ItemGroup> | ||
</Target> | ||
<PropertyGroup> | ||
<PreBuildEvent> | ||
</PreBuildEvent> | ||
<PostBuildEventDependsOn> | ||
$(PostBuildEventDependsOn); | ||
PostBuildMacros; | ||
</PostBuildEventDependsOn> | ||
</PropertyGroup> | ||
</Project> |
33 changes: 33 additions & 0 deletions
33
src/Owin.Security.Providers.Podbean/PodbeanAuthenticationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#region | ||
|
||
using System; | ||
|
||
#endregion | ||
|
||
namespace Owin.Security.Providers.Podbean | ||
{ | ||
public static class PodbeanAuthenticationExtensions | ||
{ | ||
public static IAppBuilder UsePodbeanAuthentication(this IAppBuilder app, | ||
PodbeanAuthenticationOptions options) | ||
{ | ||
if (app == null) | ||
throw new ArgumentNullException(nameof(app)); | ||
if (options == null) | ||
throw new ArgumentNullException(nameof(options)); | ||
|
||
app.Use(typeof(PodbeanAuthenticationMiddleware), app, options); | ||
|
||
return app; | ||
} | ||
|
||
public static IAppBuilder UsePodbeanAuthentication(this IAppBuilder app, string appId, string appSecret) | ||
{ | ||
return app.UsePodbeanAuthentication(new PodbeanAuthenticationOptions | ||
{ | ||
AppId = appId, | ||
AppSecret = appSecret | ||
}); | ||
} | ||
} | ||
} |
Oops, something went wrong.