Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit dcf7af7

Browse files
committed
Added DotNetOpenAuth.OAuth.Common to contain dependencies shared between OAuth 1 and OAuth 2.
Related to and closes #71
1 parent bef6c27 commit dcf7af7

File tree

26 files changed

+215
-52
lines changed

26 files changed

+215
-52
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata>
4+
<id>DotNetOpenAuth.OAuth.Common</id>
5+
<version>$version$</version>
6+
<title>DotNetOpenAuth OAuth 1/2 shared bits</title>
7+
<authors>Andrew Arnott</authors>
8+
<owners>Outercurve Foundation</owners>
9+
<projectUrl>http://www.dotnetopenauth.net/</projectUrl>
10+
<iconUrl>https://github.com/AArnott/dotnetopenid/raw/v3.4/doc/logo/dnoa-logo_32x32.png</iconUrl>
11+
<licenseUrl>http://www.opensource.org/licenses/ms-pl.html</licenseUrl>
12+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13+
<description>Contains assemblies that are required to implement OAuth 1 or 2.</description>
14+
<dependencies>
15+
<dependency id="DotNetOpenAuth.Core" version="[$version$]" />
16+
</dependencies>
17+
</metadata>
18+
<files>
19+
<file src="$OutputPath35$signed\DotNetOpenAuth.OAuth.Common.dll" target="lib\net35-full\" />
20+
<file src="$OutputPath40$signed\DotNetOpenAuth.OAuth.Common.dll" target="lib\net40-full\" />
21+
22+
<file src="$OutputPath35$DotNetOpenAuth.OAuth.Common.pdb" target="lib\net35-full\" />
23+
<file src="$OutputPath40$DotNetOpenAuth.OAuth.Common.pdb" target="lib\net40-full\" />
24+
25+
<file src="$OutputPath35$DotNetOpenAuth.OAuth.Common.xml" target="lib\net35-full\" />
26+
<file src="$OutputPath40$DotNetOpenAuth.OAuth.Common.xml" target="lib\net40-full\" />
27+
28+
<file src="..\src\DotNetOpenAuth.OAuth.Common\**\*.cs" target="src" />
29+
</files>
30+
</package>

nuget/DotNetOpenAuth.OAuth.ServiceProvider.nuspec

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@
1313
<description>Contains assemblies that are required to implement an OAuth consumer.</description>
1414
<dependencies>
1515
<dependency id="DotNetOpenAuth.OAuth.Core" version="[$version$]" />
16+
<dependency id="DotNetOpenAuth.OAuth.Common" version="[$version$]" />
1617
</dependencies>
1718
</metadata>
1819
<files>
19-
<file src="$OutputPath35$signed\DotNetOpenAuth.OAuth.ServiceProvider.dll" target="lib\net35-full\DotNetOpenAuth.OAuth.ServiceProvider.dll" />
20-
<file src="$OutputPath40$signed\DotNetOpenAuth.OAuth.ServiceProvider.dll" target="lib\net40-full\DotNetOpenAuth.OAuth.ServiceProvider.dll" />
20+
<file src="$OutputPath35$signed\DotNetOpenAuth.OAuth.ServiceProvider.dll" target="lib\net35-full\" />
21+
<file src="$OutputPath40$signed\DotNetOpenAuth.OAuth.ServiceProvider.dll" target="lib\net40-full\" />
2122

22-
<file src="$OutputPath35$DotNetOpenAuth.OAuth.ServiceProvider.pdb" target="lib\net35-full\DotNetOpenAuth.OAuth.ServiceProvider.pdb" />
23-
<file src="$OutputPath40$DotNetOpenAuth.OAuth.ServiceProvider.pdb" target="lib\net40-full\DotNetOpenAuth.OAuth.ServiceProvider.pdb" />
23+
<file src="$OutputPath35$DotNetOpenAuth.OAuth.ServiceProvider.pdb" target="lib\net35-full\" />
24+
<file src="$OutputPath40$DotNetOpenAuth.OAuth.ServiceProvider.pdb" target="lib\net40-full\" />
2425

25-
<file src="$OutputPath35$DotNetOpenAuth.OAuth.ServiceProvider.xml" target="lib\net35-full\DotNetOpenAuth.OAuth.ServiceProvider.xml" />
26-
<file src="$OutputPath40$DotNetOpenAuth.OAuth.ServiceProvider.xml" target="lib\net40-full\DotNetOpenAuth.OAuth.ServiceProvider.xml" />
26+
<file src="$OutputPath35$DotNetOpenAuth.OAuth.ServiceProvider.xml" target="lib\net35-full\" />
27+
<file src="$OutputPath40$DotNetOpenAuth.OAuth.ServiceProvider.xml" target="lib\net40-full\" />
2728

2829
<file src="..\src\DotNetOpenAuth.OAuth.ServiceProvider\**\*.cs" target="src" />
2930
</files>

nuget/DotNetOpenAuth.OAuth2.Core.nuspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<description>Contains assemblies that are required to implement an OAuth 2.0 client, authorization server or resource server.</description>
1414
<dependencies>
1515
<dependency id="DotNetOpenAuth.Core" version="[$version$]" />
16-
<dependency id="DotNetOpenAuth.OAuth.Core" version="[$version$]" />
1716
</dependencies>
1817
</metadata>
1918
<files>

nuget/DotNetOpenAuth.OAuth2.ResourceServer.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>Contains assemblies that are required to implement an OAuth 2.0 Resource Server.</description>
1414
<dependencies>
15-
<dependency id="DotNetOpenAuth.OAuth.ServiceProvider" version="[$version$]" />
1615
<dependency id="DotNetOpenAuth.OAuth2.Core" version="[$oauth2version$]" />
16+
<dependency id="DotNetOpenAuth.OAuth.Common" version="[$version$]" />
1717
</dependencies>
1818
</metadata>
1919
<files>

projecttemplates/RelyingPartyLogic/RelyingPartyLogic.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@
146146
<Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project>
147147
<Name>DotNetOpenAuth.Core</Name>
148148
</ProjectReference>
149+
<ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth.Common\DotNetOpenAuth.OAuth.Common.csproj">
150+
<Project>{115217C5-22CD-415C-A292-0DD0238CDD89}</Project>
151+
<Name>DotNetOpenAuth.OAuth.Common</Name>
152+
</ProjectReference>
149153
<ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth.ServiceProvider\DotNetOpenAuth.OAuth.ServiceProvider.csproj">
150154
<Project>{FED1923A-6D70-49B5-A37A-FB744FEC1C86}</Project>
151155
<Name>DotNetOpenAuth.OAuth.ServiceProvider</Name>

samples/OAuthServiceProvider/OAuthServiceProvider.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@
149149
<Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project>
150150
<Name>DotNetOpenAuth.Core</Name>
151151
</ProjectReference>
152+
<ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth.Common\DotNetOpenAuth.OAuth.Common.csproj">
153+
<Project>{115217C5-22CD-415C-A292-0DD0238CDD89}</Project>
154+
<Name>DotNetOpenAuth.OAuth.Common</Name>
155+
</ProjectReference>
152156
<ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth.ServiceProvider\DotNetOpenAuth.OAuth.ServiceProvider.csproj">
153157
<Project>{FED1923A-6D70-49B5-A37A-FB744FEC1C86}</Project>
154158
<Name>DotNetOpenAuth.OAuth.ServiceProvider</Name>

src/DotNetOpenAuth.Core/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
[assembly: InternalsVisibleTo("DotNetOpenAuth.OpenId.Provider, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")]
5858
[assembly: InternalsVisibleTo("DotNetOpenAuth.OpenId.Provider.UI, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")]
5959
[assembly: InternalsVisibleTo("DotNetOpenAuth.OpenIdInfoCard.UI, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")]
60+
[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")]
6061
[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")]
6162
[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth.Consumer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")]
6263
[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth.ServiceProvider, PublicKey=0024000004800000940000000602000000240000525341310004000001000100AD093C3765257C89A7010E853F2C7C741FF92FA8ACE06D7B8254702CAD5CF99104447F63AB05F8BB6F51CE0D81C8C93D2FCE8C20AAFF7042E721CBA16EAAE98778611DED11C0ABC8900DC5667F99B50A9DADEC24DBD8F2C91E3E8AD300EF64F1B4B9536CEB16FB440AF939F57624A9B486F867807C649AE4830EAB88C6C03998")]
@@ -78,6 +79,7 @@
7879
[assembly: InternalsVisibleTo("DotNetOpenAuth.OpenId.Provider")]
7980
[assembly: InternalsVisibleTo("DotNetOpenAuth.OpenId.Provider.UI")]
8081
[assembly: InternalsVisibleTo("DotNetOpenAuth.OpenIdInfoCard.UI")]
82+
[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth.Common")]
8183
[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth")]
8284
[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth.Consumer")]
8385
[assembly: InternalsVisibleTo("DotNetOpenAuth.OAuth.ServiceProvider")]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
</PropertyGroup>
8+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.props" />
9+
<PropertyGroup>
10+
<SchemaVersion>2.0</SchemaVersion>
11+
<ProjectGuid>{115217C5-22CD-415C-A292-0DD0238CDD89}</ProjectGuid>
12+
<OutputType>Library</OutputType>
13+
<AppDesignerFolder>Properties</AppDesignerFolder>
14+
<RootNamespace>DotNetOpenAuth</RootNamespace>
15+
<AssemblyName>DotNetOpenAuth.OAuth.Common</AssemblyName>
16+
</PropertyGroup>
17+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.Product.props" />
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
21+
</PropertyGroup>
22+
<ItemGroup>
23+
<Compile Include="OAuth\ChannelElements\OAuthIdentity.cs" />
24+
<Compile Include="OAuth\ChannelElements\OAuthPrincipal.cs" />
25+
<Compile Include="Properties\AssemblyInfo.cs" />
26+
</ItemGroup>
27+
<ItemGroup>
28+
<ProjectReference Include="..\DotNetOpenAuth.Core\DotNetOpenAuth.Core.csproj">
29+
<Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project>
30+
<Name>DotNetOpenAuth.Core</Name>
31+
</ProjectReference>
32+
</ItemGroup>
33+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
34+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.targets" />
35+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " />
36+
</Project>

src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/OAuthIdentity.cs renamed to src/DotNetOpenAuth.OAuth.Common/OAuth/ChannelElements/OAuthIdentity.cs

File renamed without changes.

src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/OAuthPrincipal.cs renamed to src/DotNetOpenAuth.OAuth.Common/OAuth/ChannelElements/OAuthPrincipal.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ public OAuthPrincipal(string userName, string[] roles)
3535
: this(new OAuthIdentity(userName), roles) {
3636
}
3737

38-
/// <summary>
39-
/// Initializes a new instance of the <see cref="OAuthPrincipal"/> class.
40-
/// </summary>
41-
/// <param name="token">The access token.</param>
42-
internal OAuthPrincipal(IServiceProviderAccessToken token)
43-
: this(token.Username, token.Roles) {
44-
Requires.NotNull(token, "token");
45-
46-
this.AccessToken = token.Token;
47-
}
48-
4938
/// <summary>
5039
/// Initializes a new instance of the <see cref="OAuthPrincipal"/> class.
5140
/// </summary>
@@ -57,10 +46,10 @@ internal OAuthPrincipal(OAuthIdentity identity, string[] roles) {
5746
}
5847

5948
/// <summary>
60-
/// Gets the access token used to create this principal.
49+
/// Gets or sets the access token used to create this principal.
6150
/// </summary>
6251
/// <value>A non-empty string.</value>
63-
public string AccessToken { get; private set; }
52+
public string AccessToken { get; protected set; }
6453

6554
/// <summary>
6655
/// Gets the roles that this principal has as a ReadOnlyCollection.

0 commit comments

Comments
 (0)