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

Commit 2ddd19d

Browse files
committed
We have HTTP Basic client authentication working now in OAuth 2.
1 parent bd0de82 commit 2ddd19d

File tree

49 files changed

+950
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+950
-76
lines changed

nuget/DotNetOpenAuth.OAuth2.Core.nuspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
<file src="$OutputPath35$DotNetOpenAuth.OAuth2.xml" target="lib\net35-full" />
2727
<file src="$OutputPath40$DotNetOpenAuth.OAuth2.xml" target="lib\net40-full" />
2828

29+
<file src="content\OAuth2.Core\web.config.transform" target="content\web.config.transform" />
30+
2931
<file src="..\src\DotNetOpenAuth.OAuth2\**\*.cs" target="src" />
3032
</files>
3133
</package>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<configuration>
2+
<configSections>
3+
<sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
4+
<section name="oauth2" type="DotNetOpenAuth.Configuration.OAuth2Element, DotNetOpenAuth.OAuth2" requirePermission="false" allowLocation="true" />
5+
</sectionGroup>
6+
</configSections>
7+
</configuration>

projecttemplates/MvcRelyingParty/MvcRelyingParty.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
<Compile Include="Controllers\HomeController.cs" />
8282
<Compile Include="Default.aspx.cs">
8383
<DependentUpon>Default.aspx</DependentUpon>
84-
<SubType>ASPXCodeBehind</SubType>
8584
</Compile>
8685
<Compile Include="Global.asax.cs">
8786
<DependentUpon>Global.asax</DependentUpon>
@@ -94,7 +93,6 @@
9493
<Compile Include="Properties\AssemblyInfo.cs" />
9594
<Compile Include="Setup.aspx.cs">
9695
<DependentUpon>Setup.aspx</DependentUpon>
97-
<SubType>ASPXCodeBehind</SubType>
9896
</Compile>
9997
<Compile Include="Setup.aspx.designer.cs">
10098
<DependentUpon>Setup.aspx</DependentUpon>

projecttemplates/WebFormsRelyingParty/WebFormsRelyingParty.csproj

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,42 +99,36 @@
9999
<Compile Include="Code\SiteUtilities.cs" />
100100
<Compile Include="Members\OAuthAuthorize.aspx.cs">
101101
<DependentUpon>OAuthAuthorize.aspx</DependentUpon>
102-
<SubType>ASPXCodeBehind</SubType>
103102
</Compile>
104103
<Compile Include="Members\OAuthAuthorize.aspx.designer.cs">
105104
<DependentUpon>OAuthAuthorize.aspx</DependentUpon>
106105
</Compile>
107106
<Compile Include="LoginFrame.aspx.cs">
108107
<DependentUpon>LoginFrame.aspx</DependentUpon>
109-
<SubType>ASPXCodeBehind</SubType>
110108
</Compile>
111109
<Compile Include="LoginFrame.aspx.designer.cs">
112110
<DependentUpon>LoginFrame.aspx</DependentUpon>
113111
</Compile>
114112
<Compile Include="Members\AccountInfo.aspx.cs">
115113
<DependentUpon>AccountInfo.aspx</DependentUpon>
116-
<SubType>ASPXCodeBehind</SubType>
117114
</Compile>
118115
<Compile Include="Members\AccountInfo.aspx.designer.cs">
119116
<DependentUpon>AccountInfo.aspx</DependentUpon>
120117
</Compile>
121118
<Compile Include="Admin\Admin.Master.cs">
122119
<DependentUpon>Admin.Master</DependentUpon>
123-
<SubType>ASPXCodeBehind</SubType>
124120
</Compile>
125121
<Compile Include="Admin\Admin.Master.designer.cs">
126122
<DependentUpon>Admin.Master</DependentUpon>
127123
</Compile>
128124
<Compile Include="Admin\Default.aspx.cs">
129125
<DependentUpon>Default.aspx</DependentUpon>
130-
<SubType>ASPXCodeBehind</SubType>
131126
</Compile>
132127
<Compile Include="Admin\Default.aspx.designer.cs">
133128
<DependentUpon>Default.aspx</DependentUpon>
134129
</Compile>
135130
<Compile Include="Default.aspx.cs">
136131
<DependentUpon>Default.aspx</DependentUpon>
137-
<SubType>ASPXCodeBehind</SubType>
138132
</Compile>
139133
<Compile Include="Default.aspx.designer.cs">
140134
<DependentUpon>Default.aspx</DependentUpon>
@@ -144,21 +138,18 @@
144138
</Compile>
145139
<Compile Include="Login.aspx.cs">
146140
<DependentUpon>Login.aspx</DependentUpon>
147-
<SubType>ASPXCodeBehind</SubType>
148141
</Compile>
149142
<Compile Include="Login.aspx.designer.cs">
150143
<DependentUpon>Login.aspx</DependentUpon>
151144
</Compile>
152145
<Compile Include="Logout.aspx.cs">
153146
<DependentUpon>Logout.aspx</DependentUpon>
154-
<SubType>ASPXCodeBehind</SubType>
155147
</Compile>
156148
<Compile Include="Logout.aspx.designer.cs">
157149
<DependentUpon>Logout.aspx</DependentUpon>
158150
</Compile>
159151
<Compile Include="Members\Default.aspx.cs">
160152
<DependentUpon>Default.aspx</DependentUpon>
161-
<SubType>ASPXCodeBehind</SubType>
162153
</Compile>
163154
<Compile Include="Members\Default.aspx.designer.cs">
164155
<DependentUpon>Default.aspx</DependentUpon>
@@ -169,14 +160,12 @@
169160
<Compile Include="Properties\AssemblyInfo.cs" />
170161
<Compile Include="Setup.aspx.cs">
171162
<DependentUpon>Setup.aspx</DependentUpon>
172-
<SubType>ASPXCodeBehind</SubType>
173163
</Compile>
174164
<Compile Include="Setup.aspx.designer.cs">
175165
<DependentUpon>Setup.aspx</DependentUpon>
176166
</Compile>
177167
<Compile Include="Site.Master.cs">
178168
<DependentUpon>Site.Master</DependentUpon>
179-
<SubType>ASPXCodeBehind</SubType>
180169
</Compile>
181170
<Compile Include="Site.Master.designer.cs">
182171
<DependentUpon>Site.Master</DependentUpon>

samples/OAuthAuthorizationServer/Web.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
<dotNetOpenAuth>
3939
<!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
4040
<reporting enabled="true" />
41+
<oauth2>
42+
<authorizationServer>
43+
<clientAuthenticationModules>
44+
</clientAuthenticationModules>
45+
</authorizationServer>
46+
</oauth2>
4147

4248
<!-- Relaxing SSL requirements is useful for simple samples, but NOT a good idea in production. -->
4349
<messaging relaxSslRequirements="true">

samples/OAuthClient/Facebook.aspx.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
public partial class Facebook : System.Web.UI.Page {
1111
private static readonly FacebookClient client = new FacebookClient {
1212
ClientIdentifier = ConfigurationManager.AppSettings["facebookAppID"],
13-
ClientSecret = ConfigurationManager.AppSettings["facebookAppSecret"],
13+
ClientCredentialApplicator = ClientCredentialApplicator.SecretParameter(ConfigurationManager.AppSettings["facebookAppSecret"]),
1414
};
1515

1616
protected void Page_Load(object sender, EventArgs e) {

samples/OAuthClient/WindowsLive.aspx.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public partial class WindowsLive : System.Web.UI.Page {
1515
private static readonly WindowsLiveClient client = new WindowsLiveClient {
1616
ClientIdentifier = ConfigurationManager.AppSettings["windowsLiveAppID"],
17-
ClientSecret = ConfigurationManager.AppSettings["WindowsLiveAppSecret"],
17+
ClientCredentialApplicator = ClientCredentialApplicator.SecretParameter(ConfigurationManager.AppSettings["WindowsLiveAppSecret"]),
1818
};
1919

2020
protected void Page_Load(object sender, EventArgs e) {

samples/OAuthServiceProvider/OAuthServiceProvider.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,15 @@
114114
</Compile>
115115
<Compile Include="Default.aspx.cs">
116116
<DependentUpon>Default.aspx</DependentUpon>
117-
<SubType>ASPXCodeBehind</SubType>
118117
</Compile>
119118
<Compile Include="Members\Authorize.aspx.cs">
120119
<DependentUpon>Authorize.aspx</DependentUpon>
121-
<SubType>ASPXCodeBehind</SubType>
122120
</Compile>
123121
<Compile Include="Members\AuthorizedConsumers.aspx.cs">
124122
<DependentUpon>AuthorizedConsumers.aspx</DependentUpon>
125-
<SubType>ASPXCodeBehind</SubType>
126123
</Compile>
127124
<Compile Include="TracePage.aspx.cs">
128125
<DependentUpon>TracePage.aspx</DependentUpon>
129-
<SubType>ASPXCodeBehind</SubType>
130126
</Compile>
131127
<Compile Include="TracePage.aspx.designer.cs">
132128
<DependentUpon>TracePage.aspx</DependentUpon>

src/DotNetOpenAuth.Core/Configuration/DotNetOpenAuth.xsd

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,71 @@
898898
</xs:choice>
899899
</xs:complexType>
900900
</xs:element>
901+
<xs:element name="oauth2">
902+
<xs:annotation>
903+
<xs:documentation>
904+
Settings OAuth 2 clients, authorization servers and resource servers.
905+
</xs:documentation>
906+
</xs:annotation>
907+
<xs:complexType>
908+
<xs:choice minOccurs="0" maxOccurs="unbounded">
909+
<xs:element name="client">
910+
<xs:annotation>
911+
<xs:documentation>
912+
Settings applicable to OAuth 2 Clients.
913+
</xs:documentation>
914+
</xs:annotation>
915+
<xs:complexType>
916+
<xs:choice minOccurs="0" maxOccurs="unbounded">
917+
</xs:choice>
918+
</xs:complexType>
919+
</xs:element>
920+
<xs:element name="authorizationServer">
921+
<xs:annotation>
922+
<xs:documentation>
923+
Settings applicable to OAuth 2 Authorization Servers.
924+
</xs:documentation>
925+
</xs:annotation>
926+
<xs:complexType>
927+
<xs:choice minOccurs="0" maxOccurs="unbounded">
928+
<xs:element name="clientAuthenticationModules">
929+
<xs:complexType>
930+
<xs:choice minOccurs="0" maxOccurs="unbounded">
931+
<xs:element name="add">
932+
<xs:complexType>
933+
<xs:attribute name="name" type="xs:string" use="required" />
934+
</xs:complexType>
935+
</xs:element>
936+
<xs:element name="remove">
937+
<xs:complexType>
938+
<xs:attribute name="name" type="xs:string" use="required" />
939+
</xs:complexType>
940+
</xs:element>
941+
<xs:element name="clear">
942+
<xs:complexType>
943+
<!--tag is empty-->
944+
</xs:complexType>
945+
</xs:element>
946+
</xs:choice>
947+
</xs:complexType>
948+
</xs:element>
949+
</xs:choice>
950+
</xs:complexType>
951+
</xs:element>
952+
<xs:element name="resourceServer">
953+
<xs:annotation>
954+
<xs:documentation>
955+
Settings applicable to OAuth 2 Resource Servers.
956+
</xs:documentation>
957+
</xs:annotation>
958+
<xs:complexType>
959+
<xs:choice minOccurs="0" maxOccurs="unbounded">
960+
</xs:choice>
961+
</xs:complexType>
962+
</xs:element>
963+
</xs:choice>
964+
</xs:complexType>
965+
</xs:element>
901966
<xs:element name="reporting">
902967
<xs:annotation>
903968
<xs:documentation>

src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<Compile Include="Messaging\ChannelContract.cs" />
3030
<Compile Include="Messaging\DataBagFormatterBase.cs" />
3131
<Compile Include="Messaging\HttpRequestHeaders.cs" />
32+
<Compile Include="Messaging\IHttpDirectRequest.cs" />
33+
<Compile Include="Messaging\IHttpDirectRequestContract.cs" />
3234
<Compile Include="Messaging\IHttpIndirectResponse.cs" />
3335
<Compile Include="Messaging\IMessageOriginalPayload.cs" />
3436
<Compile Include="Messaging\DirectWebRequestOptions.cs" />

0 commit comments

Comments
 (0)