diff options
Diffstat (limited to 'samples/OAuthServiceProvider')
38 files changed, 0 insertions, 2627 deletions
diff --git a/samples/OAuthServiceProvider/Code/Client.cs b/samples/OAuthServiceProvider/Code/Client.cs deleted file mode 100644 index bb4007e..0000000 --- a/samples/OAuthServiceProvider/Code/Client.cs +++ /dev/null @@ -1,40 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Client.cs" company="Andrew Arnott"> -// Copyright (c) Andrew Arnott. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace OAuthServiceProvider.Code { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using DotNetOpenAuth.OAuth2; - - public partial class Client : IConsumerDescription { - #region IConsumerDescription Members - - /// <summary> - /// Gets the client secret. - /// </summary> - string IConsumerDescription.Secret { - get { return this.ClientSecret; } - } - - /// <summary> - /// Gets the allowed callback URIs that this client has pre-registered with the service provider, if any. - /// </summary> - /// <value> - /// The URIs that user authorization responses may be directed to; must not be <c>null</c>, but may be empty. - /// </value> - /// <remarks> - /// The first element in this list (if any) will be used as the default client redirect URL if the client sends an authorization request without a redirect URL. - /// If the list is empty, any callback is allowed for this client. - /// </remarks> - List<Uri> IConsumerDescription.AllowedCallbacks { - get { return string.IsNullOrEmpty(this.Callback) ? new List<Uri>() : new List<Uri>(new Uri[] { new Uri(this.Callback) }); } - } - - #endregion - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/DataClasses.dbml b/samples/OAuthServiceProvider/Code/DataClasses.dbml deleted file mode 100644 index 906d91d..0000000 --- a/samples/OAuthServiceProvider/Code/DataClasses.dbml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><Database Name="Database" EntityNamespace="OAuthServiceProvider.Code" Class="DataClassesDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007"> - <Connection Mode="WebSettings" ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database4.mdf;Integrated Security=True;User Instance=True" SettingsObjectName="System.Configuration.ConfigurationManager.ConnectionStrings" SettingsPropertyName="DatabaseConnectionString" Provider="System.Data.SqlClient" /> - <Table Name="dbo.[User]" Member="Users"> - <Type Name="User"> - <Column Name="UserId" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> - <Column Name="OpenIDClaimedIdentifier" Type="System.String" DbType="NVarChar(150) NOT NULL" CanBeNull="false" /> - <Column Name="OpenIDFriendlyIdentifier" Type="System.String" DbType="NVarChar(150)" CanBeNull="true" /> - <Column Name="FullName" Type="System.String" DbType="NVarChar(150)" CanBeNull="false" /> - <Column Name="Age" Type="System.Int32" DbType="int" CanBeNull="true" /> - <Association Name="User_FavoriteSite" Member="FavoriteSites" ThisKey="UserId" OtherKey="UserId" Type="FavoriteSite" /> - <Association Name="User_ClientAuthorization" Member="ClientAuthorizations" Storage="_OAuthTokens" ThisKey="UserId" OtherKey="UserId" Type="ClientAuthorization" /> - </Type> - </Table> - <Table Name="dbo.FavoriteSite" Member="FavoriteSites"> - <Type Name="FavoriteSite"> - <Column Name="FavoriteSiteId" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> - <Column Name="UserId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> - <Column Name="SiteUrl" Type="System.String" DbType="NVarChar(255) NOT NULL" CanBeNull="false" /> - <Association Name="User_FavoriteSite" Member="User" ThisKey="UserId" OtherKey="UserId" Type="User" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" /> - </Type> - </Table> - <Table Name="dbo.Client" Member="Clients"> - <Type Name="Client"> - <Column Name="ClientId" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> - <Column Name="ClientIdentifier" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" /> - <Column Name="ClientSecret" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" /> - <Column Name="Callback" Type="System.String" CanBeNull="true" /> - <Column Name="Name" Type="System.String" CanBeNull="false" /> - <Association Name="Client_ClientAuthorization" Member="ClientAuthorizations" Storage="_OAuthTokens" ThisKey="ClientId" OtherKey="ClientId" Type="ClientAuthorization" /> - </Type> - </Table> - <Table Name="dbo.ClientAuthorization" Member="ClientAuthorizations"> - <Type Name="ClientAuthorization"> - <Column Name="AuthorizationId" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> - <Column Name="CreatedOnUtc" Storage="_IssueDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" /> - <Column Name="ClientId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> - <Column Name="UserId" Type="System.Int32" DbType="Int" CanBeNull="true" /> - <Column Name="Scope" Type="System.String" DbType="nvarchar(MAX)" CanBeNull="false" /> - <Column Name="ExpirationDateUtc" Type="System.DateTime" DbType="DateTime NULL" CanBeNull="true" /> - <Association Name="Client_ClientAuthorization" Member="Client" ThisKey="ClientId" OtherKey="ClientId" Type="Client" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" /> - <Association Name="User_ClientAuthorization" Member="User" ThisKey="UserId" OtherKey="UserId" Type="User" IsForeignKey="true" DeleteRule="CASCADE" /> - </Type> - </Table> - <Table Name="dbo.Nonce" Member="Nonces"> - <Type Name="Nonce"> - <Column Name="Context" Type="System.String" IsPrimaryKey="true" CanBeNull="false" /> - <Column Name="Code" Type="System.String" IsPrimaryKey="true" CanBeNull="false" /> - <Column Name="Timestamp" Type="System.DateTime" IsPrimaryKey="true" CanBeNull="false" /> - </Type> - </Table> -</Database>
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/DataClasses.dbml.layout b/samples/OAuthServiceProvider/Code/DataClasses.dbml.layout deleted file mode 100644 index 346bb49..0000000 --- a/samples/OAuthServiceProvider/Code/DataClasses.dbml.layout +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 11, 8.5" name="DataClasses"> - <DataContextMoniker Name="/DataClassesDataContext" /> - <nestedChildShapes> - <classShape Id="696d2c69-040e-411d-9257-bb664b743834" absoluteBounds="0.5, 0.5, 2.125, 1.7708968098958331"> - <DataClassMoniker Name="/DataClassesDataContext/User" /> - <nestedChildShapes> - <elementListCompartment Id="cd90aeff-476c-44a9-897f-a986e4a8305b" absoluteBounds="0.515, 0.96, 2.0949999999999998, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> - </nestedChildShapes> - </classShape> - <classShape Id="8a79b099-7f87-4766-907a-db2c3e1b5716" absoluteBounds="3.5, 0.625, 2, 1.3862939453125005"> - <DataClassMoniker Name="/DataClassesDataContext/FavoriteSite" /> - <nestedChildShapes> - <elementListCompartment Id="eba736b9-f9ec-484b-8083-c77155a49e4e" absoluteBounds="3.515, 1.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> - </nestedChildShapes> - </classShape> - <classShape Id="f909becb-85b1-4fe6-bb16-3feb3e4fe3ee" absoluteBounds="0.5, 3.5, 2, 1.7708968098958327"> - <DataClassMoniker Name="/DataClassesDataContext/Client" /> - <nestedChildShapes> - <elementListCompartment Id="464308c4-d112-4448-b0c9-d9b82fb0ca4e" absoluteBounds="0.515, 3.96, 1.9700000000000002, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> - </nestedChildShapes> - </classShape> - <classShape Id="895ebbc8-8352-4c04-9e53-b8e6c8302d36" absoluteBounds="3.5, 3.125, 2, 1.9631982421874996"> - <DataClassMoniker Name="/DataClassesDataContext/ClientAuthorization" /> - <nestedChildShapes> - <elementListCompartment Id="403126d0-3d2a-4af4-b0b8-c489a830bbd4" absoluteBounds="3.515, 3.585, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> - </nestedChildShapes> - </classShape> - <associationConnector edgePoints="[(2.625 : 1.31814697265625); (3.5 : 1.31814697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> - <AssociationMoniker Name="/DataClassesDataContext/User/User_FavoriteSite" /> - <nodes> - <classShapeMoniker Id="696d2c69-040e-411d-9257-bb664b743834" /> - <classShapeMoniker Id="8a79b099-7f87-4766-907a-db2c3e1b5716" /> - </nodes> - </associationConnector> - <classShape Id="a63562a7-acf2-4ed9-9686-52a1ad85633e" absoluteBounds="1.375, 6.375, 2, 1.3862939453124996"> - <DataClassMoniker Name="/DataClassesDataContext/Nonce" /> - <nestedChildShapes> - <elementListCompartment Id="9e4514ef-bc7b-4179-88e6-05363bf6ee5e" absoluteBounds="1.39, 6.835, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> - </nestedChildShapes> - </classShape> - <associationConnector edgePoints="[(2.5 : 4.29409912109375); (3.5 : 4.29409912109375)]" fixedFrom="NotFixed" fixedTo="NotFixed"> - <AssociationMoniker Name="/DataClassesDataContext/Client/Client_ClientAuthorization" /> - <nodes> - <classShapeMoniker Id="f909becb-85b1-4fe6-bb16-3feb3e4fe3ee" /> - <classShapeMoniker Id="895ebbc8-8352-4c04-9e53-b8e6c8302d36" /> - </nodes> - </associationConnector> - <associationConnector edgePoints="[(2.59375 : 2.27089680989583); (2.59375 : 3.28125); (3.5 : 3.28125)]" fixedFrom="NotFixed" fixedTo="NotFixed"> - <AssociationMoniker Name="/DataClassesDataContext/User/User_ClientAuthorization" /> - <nodes> - <classShapeMoniker Id="696d2c69-040e-411d-9257-bb664b743834" /> - <classShapeMoniker Id="895ebbc8-8352-4c04-9e53-b8e6c8302d36" /> - </nodes> - </associationConnector> - </nestedChildShapes> -</ordesignerObjectsDiagram>
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/DataClasses.designer.cs b/samples/OAuthServiceProvider/Code/DataClasses.designer.cs deleted file mode 100644 index 0f70a2c..0000000 --- a/samples/OAuthServiceProvider/Code/DataClasses.designer.cs +++ /dev/null @@ -1,1046 +0,0 @@ -#pragma warning disable 1591 -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace OAuthServiceProvider.Code -{ - using System.Data.Linq; - using System.Data.Linq.Mapping; - using System.Data; - using System.Collections.Generic; - using System.Reflection; - using System.Linq; - using System.Linq.Expressions; - using System.ComponentModel; - using System; - - - [global::System.Data.Linq.Mapping.DatabaseAttribute(Name="Database")] - public partial class DataClassesDataContext : System.Data.Linq.DataContext - { - - private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource(); - - #region Extensibility Method Definitions - partial void OnCreated(); - partial void InsertUser(User instance); - partial void UpdateUser(User instance); - partial void DeleteUser(User instance); - partial void InsertFavoriteSite(FavoriteSite instance); - partial void UpdateFavoriteSite(FavoriteSite instance); - partial void DeleteFavoriteSite(FavoriteSite instance); - partial void InsertClient(Client instance); - partial void UpdateClient(Client instance); - partial void DeleteClient(Client instance); - partial void InsertClientAuthorization(ClientAuthorization instance); - partial void UpdateClientAuthorization(ClientAuthorization instance); - partial void DeleteClientAuthorization(ClientAuthorization instance); - partial void InsertNonce(Nonce instance); - partial void UpdateNonce(Nonce instance); - partial void DeleteNonce(Nonce instance); - #endregion - - public DataClassesDataContext() : - base(global::System.Configuration.ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString, mappingSource) - { - OnCreated(); - } - - public DataClassesDataContext(string connection) : - base(connection, mappingSource) - { - OnCreated(); - } - - public DataClassesDataContext(System.Data.IDbConnection connection) : - base(connection, mappingSource) - { - OnCreated(); - } - - public DataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : - base(connection, mappingSource) - { - OnCreated(); - } - - public DataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : - base(connection, mappingSource) - { - OnCreated(); - } - - public System.Data.Linq.Table<User> Users - { - get - { - return this.GetTable<User>(); - } - } - - public System.Data.Linq.Table<FavoriteSite> FavoriteSites - { - get - { - return this.GetTable<FavoriteSite>(); - } - } - - public System.Data.Linq.Table<Client> Clients - { - get - { - return this.GetTable<Client>(); - } - } - - public System.Data.Linq.Table<ClientAuthorization> ClientAuthorizations - { - get - { - return this.GetTable<ClientAuthorization>(); - } - } - - public System.Data.Linq.Table<Nonce> Nonces - { - get - { - return this.GetTable<Nonce>(); - } - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.[User]")] - public partial class User : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private int _UserId; - - private string _OpenIDClaimedIdentifier; - - private string _OpenIDFriendlyIdentifier; - - private string _FullName; - - private System.Nullable<int> _Age; - - private EntitySet<FavoriteSite> _FavoriteSites; - - private EntitySet<ClientAuthorization> _OAuthTokens; - - #region Extensibility Method Definitions - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnUserIdChanging(int value); - partial void OnUserIdChanged(); - partial void OnOpenIDClaimedIdentifierChanging(string value); - partial void OnOpenIDClaimedIdentifierChanged(); - partial void OnOpenIDFriendlyIdentifierChanging(string value); - partial void OnOpenIDFriendlyIdentifierChanged(); - partial void OnFullNameChanging(string value); - partial void OnFullNameChanged(); - partial void OnAgeChanging(System.Nullable<int> value); - partial void OnAgeChanged(); - #endregion - - public User() - { - this._FavoriteSites = new EntitySet<FavoriteSite>(new Action<FavoriteSite>(this.attach_FavoriteSites), new Action<FavoriteSite>(this.detach_FavoriteSites)); - this._OAuthTokens = new EntitySet<ClientAuthorization>(new Action<ClientAuthorization>(this.attach_OAuthTokens), new Action<ClientAuthorization>(this.detach_OAuthTokens)); - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] - public int UserId - { - get - { - return this._UserId; - } - set - { - if ((this._UserId != value)) - { - this.OnUserIdChanging(value); - this.SendPropertyChanging(); - this._UserId = value; - this.SendPropertyChanged("UserId"); - this.OnUserIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OpenIDClaimedIdentifier", DbType="NVarChar(150) NOT NULL", CanBeNull=false)] - public string OpenIDClaimedIdentifier - { - get - { - return this._OpenIDClaimedIdentifier; - } - set - { - if ((this._OpenIDClaimedIdentifier != value)) - { - this.OnOpenIDClaimedIdentifierChanging(value); - this.SendPropertyChanging(); - this._OpenIDClaimedIdentifier = value; - this.SendPropertyChanged("OpenIDClaimedIdentifier"); - this.OnOpenIDClaimedIdentifierChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OpenIDFriendlyIdentifier", DbType="NVarChar(150)")] - public string OpenIDFriendlyIdentifier - { - get - { - return this._OpenIDFriendlyIdentifier; - } - set - { - if ((this._OpenIDFriendlyIdentifier != value)) - { - this.OnOpenIDFriendlyIdentifierChanging(value); - this.SendPropertyChanging(); - this._OpenIDFriendlyIdentifier = value; - this.SendPropertyChanged("OpenIDFriendlyIdentifier"); - this.OnOpenIDFriendlyIdentifierChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FullName", DbType="NVarChar(150)", CanBeNull=false)] - public string FullName - { - get - { - return this._FullName; - } - set - { - if ((this._FullName != value)) - { - this.OnFullNameChanging(value); - this.SendPropertyChanging(); - this._FullName = value; - this.SendPropertyChanged("FullName"); - this.OnFullNameChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Age", DbType="int")] - public System.Nullable<int> Age - { - get - { - return this._Age; - } - set - { - if ((this._Age != value)) - { - this.OnAgeChanging(value); - this.SendPropertyChanging(); - this._Age = value; - this.SendPropertyChanged("Age"); - this.OnAgeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_FavoriteSite", Storage="_FavoriteSites", ThisKey="UserId", OtherKey="UserId")] - public EntitySet<FavoriteSite> FavoriteSites - { - get - { - return this._FavoriteSites; - } - set - { - this._FavoriteSites.Assign(value); - } - } - - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_ClientAuthorization", Storage="_OAuthTokens", ThisKey="UserId", OtherKey="UserId")] - public EntitySet<ClientAuthorization> ClientAuthorizations - { - get - { - return this._OAuthTokens; - } - set - { - this._OAuthTokens.Assign(value); - } - } - - public event PropertyChangingEventHandler PropertyChanging; - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void SendPropertyChanging() - { - if ((this.PropertyChanging != null)) - { - this.PropertyChanging(this, emptyChangingEventArgs); - } - } - - protected virtual void SendPropertyChanged(String propertyName) - { - if ((this.PropertyChanged != null)) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - private void attach_FavoriteSites(FavoriteSite entity) - { - this.SendPropertyChanging(); - entity.User = this; - } - - private void detach_FavoriteSites(FavoriteSite entity) - { - this.SendPropertyChanging(); - entity.User = null; - } - - private void attach_OAuthTokens(ClientAuthorization entity) - { - this.SendPropertyChanging(); - entity.User = this; - } - - private void detach_OAuthTokens(ClientAuthorization entity) - { - this.SendPropertyChanging(); - entity.User = null; - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.FavoriteSite")] - public partial class FavoriteSite : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private int _FavoriteSiteId; - - private int _UserId; - - private string _SiteUrl; - - private EntityRef<User> _User; - - #region Extensibility Method Definitions - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnFavoriteSiteIdChanging(int value); - partial void OnFavoriteSiteIdChanged(); - partial void OnUserIdChanging(int value); - partial void OnUserIdChanged(); - partial void OnSiteUrlChanging(string value); - partial void OnSiteUrlChanged(); - #endregion - - public FavoriteSite() - { - this._User = default(EntityRef<User>); - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FavoriteSiteId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] - public int FavoriteSiteId - { - get - { - return this._FavoriteSiteId; - } - set - { - if ((this._FavoriteSiteId != value)) - { - this.OnFavoriteSiteIdChanging(value); - this.SendPropertyChanging(); - this._FavoriteSiteId = value; - this.SendPropertyChanged("FavoriteSiteId"); - this.OnFavoriteSiteIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="Int NOT NULL")] - public int UserId - { - get - { - return this._UserId; - } - set - { - if ((this._UserId != value)) - { - if (this._User.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } - this.OnUserIdChanging(value); - this.SendPropertyChanging(); - this._UserId = value; - this.SendPropertyChanged("UserId"); - this.OnUserIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SiteUrl", DbType="NVarChar(255) NOT NULL", CanBeNull=false)] - public string SiteUrl - { - get - { - return this._SiteUrl; - } - set - { - if ((this._SiteUrl != value)) - { - this.OnSiteUrlChanging(value); - this.SendPropertyChanging(); - this._SiteUrl = value; - this.SendPropertyChanged("SiteUrl"); - this.OnSiteUrlChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_FavoriteSite", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")] - public User User - { - get - { - return this._User.Entity; - } - set - { - User previousValue = this._User.Entity; - if (((previousValue != value) - || (this._User.HasLoadedOrAssignedValue == false))) - { - this.SendPropertyChanging(); - if ((previousValue != null)) - { - this._User.Entity = null; - previousValue.FavoriteSites.Remove(this); - } - this._User.Entity = value; - if ((value != null)) - { - value.FavoriteSites.Add(this); - this._UserId = value.UserId; - } - else - { - this._UserId = default(int); - } - this.SendPropertyChanged("User"); - } - } - } - - public event PropertyChangingEventHandler PropertyChanging; - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void SendPropertyChanging() - { - if ((this.PropertyChanging != null)) - { - this.PropertyChanging(this, emptyChangingEventArgs); - } - } - - protected virtual void SendPropertyChanged(String propertyName) - { - if ((this.PropertyChanged != null)) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Client")] - public partial class Client : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private int _ClientId; - - private string _ClientIdentifier; - - private string _ClientSecret; - - private string _Callback; - - private string _Name; - - private EntitySet<ClientAuthorization> _OAuthTokens; - - #region Extensibility Method Definitions - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnClientIdChanging(int value); - partial void OnClientIdChanged(); - partial void OnClientIdentifierChanging(string value); - partial void OnClientIdentifierChanged(); - partial void OnClientSecretChanging(string value); - partial void OnClientSecretChanged(); - partial void OnCallbackChanging(string value); - partial void OnCallbackChanged(); - partial void OnNameChanging(string value); - partial void OnNameChanged(); - #endregion - - public Client() - { - this._OAuthTokens = new EntitySet<ClientAuthorization>(new Action<ClientAuthorization>(this.attach_OAuthTokens), new Action<ClientAuthorization>(this.detach_OAuthTokens)); - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClientId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] - public int ClientId - { - get - { - return this._ClientId; - } - set - { - if ((this._ClientId != value)) - { - this.OnClientIdChanging(value); - this.SendPropertyChanging(); - this._ClientId = value; - this.SendPropertyChanged("ClientId"); - this.OnClientIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClientIdentifier", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] - public string ClientIdentifier - { - get - { - return this._ClientIdentifier; - } - set - { - if ((this._ClientIdentifier != value)) - { - this.OnClientIdentifierChanging(value); - this.SendPropertyChanging(); - this._ClientIdentifier = value; - this.SendPropertyChanged("ClientIdentifier"); - this.OnClientIdentifierChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClientSecret", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] - public string ClientSecret - { - get - { - return this._ClientSecret; - } - set - { - if ((this._ClientSecret != value)) - { - this.OnClientSecretChanging(value); - this.SendPropertyChanging(); - this._ClientSecret = value; - this.SendPropertyChanged("ClientSecret"); - this.OnClientSecretChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Callback")] - public string Callback - { - get - { - return this._Callback; - } - set - { - if ((this._Callback != value)) - { - this.OnCallbackChanging(value); - this.SendPropertyChanging(); - this._Callback = value; - this.SendPropertyChanged("Callback"); - this.OnCallbackChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", CanBeNull=false)] - public string Name - { - get - { - return this._Name; - } - set - { - if ((this._Name != value)) - { - this.OnNameChanging(value); - this.SendPropertyChanging(); - this._Name = value; - this.SendPropertyChanged("Name"); - this.OnNameChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Client_ClientAuthorization", Storage="_OAuthTokens", ThisKey="ClientId", OtherKey="ClientId")] - public EntitySet<ClientAuthorization> ClientAuthorizations - { - get - { - return this._OAuthTokens; - } - set - { - this._OAuthTokens.Assign(value); - } - } - - public event PropertyChangingEventHandler PropertyChanging; - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void SendPropertyChanging() - { - if ((this.PropertyChanging != null)) - { - this.PropertyChanging(this, emptyChangingEventArgs); - } - } - - protected virtual void SendPropertyChanged(String propertyName) - { - if ((this.PropertyChanged != null)) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - private void attach_OAuthTokens(ClientAuthorization entity) - { - this.SendPropertyChanging(); - entity.Client = this; - } - - private void detach_OAuthTokens(ClientAuthorization entity) - { - this.SendPropertyChanging(); - entity.Client = null; - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ClientAuthorization")] - public partial class ClientAuthorization : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private int _AuthorizationId; - - private System.DateTime _IssueDate; - - private int _ClientId; - - private System.Nullable<int> _UserId; - - private string _Scope; - - private System.Nullable<System.DateTime> _ExpirationDateUtc; - - private EntityRef<Client> _Client; - - private EntityRef<User> _User; - - #region Extensibility Method Definitions - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnAuthorizationIdChanging(int value); - partial void OnAuthorizationIdChanged(); - partial void OnCreatedOnUtcChanging(System.DateTime value); - partial void OnCreatedOnUtcChanged(); - partial void OnClientIdChanging(int value); - partial void OnClientIdChanged(); - partial void OnUserIdChanging(System.Nullable<int> value); - partial void OnUserIdChanged(); - partial void OnScopeChanging(string value); - partial void OnScopeChanged(); - partial void OnExpirationDateUtcChanging(System.Nullable<System.DateTime> value); - partial void OnExpirationDateUtcChanged(); - #endregion - - public ClientAuthorization() - { - this._Client = default(EntityRef<Client>); - this._User = default(EntityRef<User>); - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AuthorizationId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] - public int AuthorizationId - { - get - { - return this._AuthorizationId; - } - set - { - if ((this._AuthorizationId != value)) - { - this.OnAuthorizationIdChanging(value); - this.SendPropertyChanging(); - this._AuthorizationId = value; - this.SendPropertyChanged("AuthorizationId"); - this.OnAuthorizationIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IssueDate", DbType="DateTime NOT NULL")] - public System.DateTime CreatedOnUtc - { - get - { - return this._IssueDate; - } - set - { - if ((this._IssueDate != value)) - { - this.OnCreatedOnUtcChanging(value); - this.SendPropertyChanging(); - this._IssueDate = value; - this.SendPropertyChanged("CreatedOnUtc"); - this.OnCreatedOnUtcChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClientId", DbType="Int NOT NULL")] - public int ClientId - { - get - { - return this._ClientId; - } - set - { - if ((this._ClientId != value)) - { - if (this._Client.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } - this.OnClientIdChanging(value); - this.SendPropertyChanging(); - this._ClientId = value; - this.SendPropertyChanged("ClientId"); - this.OnClientIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="Int")] - public System.Nullable<int> UserId - { - get - { - return this._UserId; - } - set - { - if ((this._UserId != value)) - { - if (this._User.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } - this.OnUserIdChanging(value); - this.SendPropertyChanging(); - this._UserId = value; - this.SendPropertyChanged("UserId"); - this.OnUserIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Scope", DbType="nvarchar(MAX)", CanBeNull=false)] - public string Scope - { - get - { - return this._Scope; - } - set - { - if ((this._Scope != value)) - { - this.OnScopeChanging(value); - this.SendPropertyChanging(); - this._Scope = value; - this.SendPropertyChanged("Scope"); - this.OnScopeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExpirationDateUtc", DbType="DateTime NULL")] - public System.Nullable<System.DateTime> ExpirationDateUtc - { - get - { - return this._ExpirationDateUtc; - } - set - { - if ((this._ExpirationDateUtc != value)) - { - this.OnExpirationDateUtcChanging(value); - this.SendPropertyChanging(); - this._ExpirationDateUtc = value; - this.SendPropertyChanged("ExpirationDateUtc"); - this.OnExpirationDateUtcChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Client_ClientAuthorization", Storage="_Client", ThisKey="ClientId", OtherKey="ClientId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")] - public Client Client - { - get - { - return this._Client.Entity; - } - set - { - Client previousValue = this._Client.Entity; - if (((previousValue != value) - || (this._Client.HasLoadedOrAssignedValue == false))) - { - this.SendPropertyChanging(); - if ((previousValue != null)) - { - this._Client.Entity = null; - previousValue.ClientAuthorizations.Remove(this); - } - this._Client.Entity = value; - if ((value != null)) - { - value.ClientAuthorizations.Add(this); - this._ClientId = value.ClientId; - } - else - { - this._ClientId = default(int); - } - this.SendPropertyChanged("Client"); - } - } - } - - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_ClientAuthorization", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true, DeleteRule="CASCADE")] - public User User - { - get - { - return this._User.Entity; - } - set - { - User previousValue = this._User.Entity; - if (((previousValue != value) - || (this._User.HasLoadedOrAssignedValue == false))) - { - this.SendPropertyChanging(); - if ((previousValue != null)) - { - this._User.Entity = null; - previousValue.ClientAuthorizations.Remove(this); - } - this._User.Entity = value; - if ((value != null)) - { - value.ClientAuthorizations.Add(this); - this._UserId = value.UserId; - } - else - { - this._UserId = default(Nullable<int>); - } - this.SendPropertyChanged("User"); - } - } - } - - public event PropertyChangingEventHandler PropertyChanging; - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void SendPropertyChanging() - { - if ((this.PropertyChanging != null)) - { - this.PropertyChanging(this, emptyChangingEventArgs); - } - } - - protected virtual void SendPropertyChanged(String propertyName) - { - if ((this.PropertyChanged != null)) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Nonce")] - public partial class Nonce : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private string _Context; - - private string _Code; - - private System.DateTime _Timestamp; - - #region Extensibility Method Definitions - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnContextChanging(string value); - partial void OnContextChanged(); - partial void OnCodeChanging(string value); - partial void OnCodeChanged(); - partial void OnTimestampChanging(System.DateTime value); - partial void OnTimestampChanged(); - #endregion - - public Nonce() - { - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Context", CanBeNull=false, IsPrimaryKey=true)] - public string Context - { - get - { - return this._Context; - } - set - { - if ((this._Context != value)) - { - this.OnContextChanging(value); - this.SendPropertyChanging(); - this._Context = value; - this.SendPropertyChanged("Context"); - this.OnContextChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Code", CanBeNull=false, IsPrimaryKey=true)] - public string Code - { - get - { - return this._Code; - } - set - { - if ((this._Code != value)) - { - this.OnCodeChanging(value); - this.SendPropertyChanging(); - this._Code = value; - this.SendPropertyChanged("Code"); - this.OnCodeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Timestamp", IsPrimaryKey=true)] - public System.DateTime Timestamp - { - get - { - return this._Timestamp; - } - set - { - if ((this._Timestamp != value)) - { - this.OnTimestampChanging(value); - this.SendPropertyChanging(); - this._Timestamp = value; - this.SendPropertyChanged("Timestamp"); - this.OnTimestampChanged(); - } - } - } - - public event PropertyChangingEventHandler PropertyChanging; - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void SendPropertyChanging() - { - if ((this.PropertyChanging != null)) - { - this.PropertyChanging(this, emptyChangingEventArgs); - } - } - - protected virtual void SendPropertyChanged(String propertyName) - { - if ((this.PropertyChanged != null)) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } -} -#pragma warning restore 1591 diff --git a/samples/OAuthServiceProvider/Code/DatabaseNonceStore.cs b/samples/OAuthServiceProvider/Code/DatabaseNonceStore.cs deleted file mode 100644 index 7c37a25..0000000 --- a/samples/OAuthServiceProvider/Code/DatabaseNonceStore.cs +++ /dev/null @@ -1,55 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Data.SqlClient; - using DotNetOpenAuth.Messaging.Bindings; - - /// <summary> - /// A database-persisted nonce store. - /// </summary> - public class DatabaseNonceStore : INonceStore { - /// <summary> - /// Initializes a new instance of the <see cref="DatabaseNonceStore"/> class. - /// </summary> - public DatabaseNonceStore() { - } - - #region INonceStore Members - - /// <summary> - /// Stores a given nonce and timestamp. - /// </summary> - /// <param name="context">The context, or namespace, within which the - /// <paramref name="nonce"/> must be unique. - /// The context SHOULD be treated as case-sensitive. - /// The value will never be <c>null</c> but may be the empty string.</param> - /// <param name="nonce">A series of random characters.</param> - /// <param name="timestampUtc">The UTC timestamp that together with the nonce string make it unique - /// within the given <paramref name="context"/>. - /// The timestamp may also be used by the data store to clear out old nonces.</param> - /// <returns> - /// True if the context+nonce+timestamp (combination) was not previously in the database. - /// False if the nonce was stored previously with the same timestamp and context. - /// </returns> - /// <remarks> - /// The nonce must be stored for no less than the maximum time window a message may - /// be processed within before being discarded as an expired message. - /// This maximum message age can be looked up via the - /// <see cref="DotNetOpenAuth.Configuration.MessagingElement.MaximumMessageLifetime"/> - /// property, accessible via the <see cref="DotNetOpenAuth.Configuration.DotNetOpenAuthSection.Configuration"/> - /// property. - /// </remarks> - public bool StoreNonce(string context, string nonce, DateTime timestampUtc) { - Global.DataContext.Nonces.InsertOnSubmit(new Nonce { Context = context, Code = nonce, Timestamp = timestampUtc }); - try { - Global.DataContext.SubmitChanges(); - return true; - } catch (System.Data.Linq.DuplicateKeyException) { - return false; - } catch (SqlException) { - return false; - } - } - - #endregion - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/Global.cs b/samples/OAuthServiceProvider/Code/Global.cs deleted file mode 100644 index 580cbf4..0000000 --- a/samples/OAuthServiceProvider/Code/Global.cs +++ /dev/null @@ -1,111 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Linq; - using System.ServiceModel; - using System.Text; - using System.Web; - using DotNetOpenAuth.OAuth2; - using DotNetOpenAuth.OAuth2.Messages; - - /// <summary> - /// The web application global events and properties. - /// </summary> - public class Global : HttpApplication { - /// <summary> - /// An application memory cache of recent log messages. - /// </summary> - public static StringBuilder LogMessages = new StringBuilder(); - - /// <summary> - /// The logger for this sample to use. - /// </summary> - public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthServiceProvider"); - - public static AuthorizationServer AuthorizationServer = new AuthorizationServer(new OAuth2AuthorizationServer()); - - /// <summary> - /// Gets the transaction-protected database connection for the current request. - /// </summary> - public static DataClassesDataContext DataContext { - get { - DataClassesDataContext dataContext = dataContextSimple; - if (dataContext == null) { - dataContext = new DataClassesDataContext(); - dataContext.Connection.Open(); - dataContext.Transaction = dataContext.Connection.BeginTransaction(); - dataContextSimple = dataContext; - } - - return dataContext; - } - } - - public static DatabaseNonceStore NonceStore { get; set; } - - public static User LoggedInUser { - get { return Global.DataContext.Users.SingleOrDefault(user => user.OpenIDClaimedIdentifier == HttpContext.Current.User.Identity.Name); } - } - - private static DataClassesDataContext dataContextSimple { - get { - if (HttpContext.Current != null) { - return HttpContext.Current.Items["DataContext"] as DataClassesDataContext; - } else if (OperationContext.Current != null) { - object data; - if (OperationContext.Current.IncomingMessageProperties.TryGetValue("DataContext", out data)) { - return data as DataClassesDataContext; - } else { - return null; - } - } else { - throw new InvalidOperationException(); - } - } - - set { - if (HttpContext.Current != null) { - HttpContext.Current.Items["DataContext"] = value; - } else if (OperationContext.Current != null) { - OperationContext.Current.IncomingMessageProperties["DataContext"] = value; - } else { - throw new InvalidOperationException(); - } - } - } - - private static void CommitAndCloseDatabaseIfNecessary() { - var dataContext = dataContextSimple; - if (dataContext != null) { - dataContext.SubmitChanges(); - dataContext.Transaction.Commit(); - dataContext.Connection.Close(); - } - } - - private void Application_Start(object sender, EventArgs e) { - log4net.Config.XmlConfigurator.Configure(); - Logger.Info("Sample starting..."); - string appPath = HttpContext.Current.Request.ApplicationPath; - if (!appPath.EndsWith("/")) { - appPath += "/"; - } - - Global.NonceStore = new DatabaseNonceStore(); - } - - private void Application_End(object sender, EventArgs e) { - Logger.Info("Sample shutting down..."); - - // this would be automatic, but in partial trust scenarios it is not. - log4net.LogManager.Shutdown(); - } - - private void Application_Error(object sender, EventArgs e) { - Logger.Error("An unhandled exception occurred in ASP.NET processing: " + Server.GetLastError(), Server.GetLastError()); - } - - private void Application_EndRequest(object sender, EventArgs e) { - CommitAndCloseDatabaseIfNecessary(); - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/IDataApi.cs b/samples/OAuthServiceProvider/Code/IDataApi.cs deleted file mode 100644 index 45853cd..0000000 --- a/samples/OAuthServiceProvider/Code/IDataApi.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Runtime.Serialization; - using System.ServiceModel; - using System.Text; - - [ServiceContract] - public interface IDataApi { - [OperationContract] - int? GetAge(); - - [OperationContract] - string GetName(); - - [OperationContract] - string[] GetFavoriteSites(); - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/OAuth2AuthorizationServer.cs b/samples/OAuthServiceProvider/Code/OAuth2AuthorizationServer.cs deleted file mode 100644 index ff87267..0000000 --- a/samples/OAuthServiceProvider/Code/OAuth2AuthorizationServer.cs +++ /dev/null @@ -1,109 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Security.Cryptography; - using System.Web; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.Messaging.Bindings; - using DotNetOpenAuth.OAuth2; - using DotNetOpenAuth.OAuth2.ChannelElements; - using DotNetOpenAuth.OAuth2.Messages; - - internal class OAuth2AuthorizationServer : IAuthorizationServer { - internal static readonly RSAParameters AsymmetricKey; - - private static readonly byte[] secret; - - private readonly INonceStore nonceStore = new DatabaseNonceStore(); - - static OAuth2AuthorizationServer() { - // For this sample, we just generate random secrets. - RandomNumberGenerator crypto = new RNGCryptoServiceProvider(); - secret = new byte[16]; - crypto.GetBytes(secret); - - AsymmetricKey = new RSACryptoServiceProvider().ExportParameters(true); - } - - #region Implementation of IAuthorizationServer - - public byte[] Secret { - get { return secret; } - } - - public INonceStore VerificationCodeNonceStore { - get { return this.nonceStore; } - } - - public RSAParameters AccessTokenSigningPrivateKey { - get { return AsymmetricKey; } - } - - public IConsumerDescription GetClient(string clientIdentifier) { - var consumerRow = Global.DataContext.Clients.SingleOrDefault( - consumerCandidate => consumerCandidate.ClientIdentifier == clientIdentifier); - if (consumerRow == null) { - throw new ArgumentOutOfRangeException("clientIdentifier"); - } - - return consumerRow; - } - - #endregion - - public bool IsAuthorizationValid(IAuthorizationDescription authorization) { - return this.IsAuthorizationValid(authorization.Scope, authorization.ClientIdentifier, authorization.UtcIssued, authorization.User); - } - - public bool CanBeAutoApproved(EndUserAuthorizationRequest authorizationRequest) { - if (authorizationRequest == null) { - throw new ArgumentNullException("authorizationRequest"); - } - - // NEVER issue an auto-approval to a client that would end up getting an access token immediately - // (without a client secret), as that would allow ANY client to spoof an approved client's identity - // and obtain unauthorized access to user data. - if (authorizationRequest.ResponseType == EndUserAuthorizationResponseType.AuthorizationCode) { - // Never issue auto-approval if the client secret is blank, since that too makes it easy to spoof - // a client's identity and obtain unauthorized access. - var requestingClient = Global.DataContext.Clients.First(c => c.ClientIdentifier == authorizationRequest.ClientIdentifier); - if (!string.IsNullOrEmpty(requestingClient.ClientSecret)) { - return this.IsAuthorizationValid( - authorizationRequest.Scope, - authorizationRequest.ClientIdentifier, - DateTime.UtcNow, - HttpContext.Current.User.Identity.Name); - } - } - - // Default to not auto-approving. - return false; - } - - private bool IsAuthorizationValid(HashSet<string> requestedScopes, string clientIdentifier, DateTime issuedUtc, string username) { - var grantedScopeStrings = from auth in Global.DataContext.ClientAuthorizations - where - auth.Client.ClientIdentifier == clientIdentifier && - auth.CreatedOnUtc <= issuedUtc && - (!auth.ExpirationDateUtc.HasValue || auth.ExpirationDateUtc.Value >= DateTime.UtcNow) && - auth.User.OpenIDClaimedIdentifier == username - select auth.Scope; - - if (!grantedScopeStrings.Any()) { - // No granted authorizations prior to the issuance of this token, so it must have been revoked. - // Even if later authorizations restore this client's ability to call in, we can't allow - // access tokens issued before the re-authorization because the revoked authorization should - // effectively and permanently revoke all access and refresh tokens. - return false; - } - - var grantedScopes = new HashSet<string>(OAuthUtilities.ScopeStringComparer); - foreach (string scope in grantedScopeStrings) { - grantedScopes.UnionWith(OAuthUtilities.SplitScopes(scope)); - } - - return requestedScopes.IsSubsetOf(grantedScopes); - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs b/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs deleted file mode 100644 index aa5428f..0000000 --- a/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs +++ /dev/null @@ -1,79 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Collections.Generic; - using System.IdentityModel.Policy; - using System.Linq; - using System.Security.Principal; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Security; - - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth2; - - using ProtocolException = System.ServiceModel.ProtocolException; - - /// <summary> - /// A WCF extension to authenticate incoming messages using OAuth. - /// </summary> - public class OAuthAuthorizationManager : ServiceAuthorizationManager { - public OAuthAuthorizationManager() { - } - - protected override bool CheckAccessCore(OperationContext operationContext) { - if (!base.CheckAccessCore(operationContext)) { - return false; - } - - var httpDetails = operationContext.RequestContext.RequestMessage.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty; - var requestUri = operationContext.RequestContext.RequestMessage.Properties["OriginalHttpRequestUri"] as Uri; - - try { - var principal = VerifyOAuth2(httpDetails, requestUri); - if (principal != null) { - var policy = new OAuthPrincipalAuthorizationPolicy(principal); - var policies = new List<IAuthorizationPolicy> { - policy, - }; - - var securityContext = new ServiceSecurityContext(policies.AsReadOnly()); - if (operationContext.IncomingMessageProperties.Security != null) { - operationContext.IncomingMessageProperties.Security.ServiceSecurityContext = securityContext; - } else { - operationContext.IncomingMessageProperties.Security = new SecurityMessageProperty { - ServiceSecurityContext = securityContext, - }; - } - - securityContext.AuthorizationContext.Properties["Identities"] = new List<IIdentity> { - principal.Identity, - }; - - // Only allow this method call if the access token scope permits it. - return principal.IsInRole(operationContext.IncomingMessageHeaders.Action); - } else { - return false; - } - } catch (ProtocolException ex) { - Global.Logger.Error("Error processing OAuth messages.", ex); - } - - return false; - } - - private static IPrincipal VerifyOAuth2(HttpRequestMessageProperty httpDetails, Uri requestUri) { - // for this sample where the auth server and resource server are the same site, - // we use the same public/private key. - var resourceServer = new ResourceServer( - new StandardAccessTokenAnalyzer( - OAuth2AuthorizationServer.AsymmetricKey, - OAuth2AuthorizationServer.AsymmetricKey)); - - IPrincipal result; - var error = resourceServer.VerifyAccess(new HttpRequestInfo(httpDetails, requestUri), out result); - - // TODO: return the prepared error code. - return error != null ? null : result; - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/OAuthPrincipalAuthorizationPolicy.cs b/samples/OAuthServiceProvider/Code/OAuthPrincipalAuthorizationPolicy.cs deleted file mode 100644 index cf14eab..0000000 --- a/samples/OAuthServiceProvider/Code/OAuthPrincipalAuthorizationPolicy.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Collections.Generic; - using System.IdentityModel.Claims; - using System.IdentityModel.Policy; - using System.Linq; - using System.Security.Principal; - using System.Web; - - public class OAuthPrincipalAuthorizationPolicy : IAuthorizationPolicy { - private readonly Guid uniqueId = Guid.NewGuid(); - private readonly IPrincipal principal; - - /// <summary> - /// Initializes a new instance of the <see cref="OAuthPrincipalAuthorizationPolicy"/> class. - /// </summary> - /// <param name="principal">The principal.</param> - public OAuthPrincipalAuthorizationPolicy(IPrincipal principal) { - this.principal = principal; - } - - #region IAuthorizationComponent Members - - /// <summary> - /// Gets a unique ID for this instance. - /// </summary> - public string Id { - get { return this.uniqueId.ToString(); } - } - - #endregion - - #region IAuthorizationPolicy Members - - public ClaimSet Issuer { - get { return ClaimSet.System; } - } - - public bool Evaluate(EvaluationContext evaluationContext, ref object state) { - evaluationContext.AddClaimSet(this, new DefaultClaimSet(Claim.CreateNameClaim(this.principal.Identity.Name))); - evaluationContext.Properties["Principal"] = this.principal; - return true; - } - - #endregion - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/TracePageAppender.cs b/samples/OAuthServiceProvider/Code/TracePageAppender.cs deleted file mode 100644 index 8f97c89..0000000 --- a/samples/OAuthServiceProvider/Code/TracePageAppender.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Collections.Generic; - using System.IO; - using System.Web; - - public class TracePageAppender : log4net.Appender.AppenderSkeleton { - protected override void Append(log4net.Core.LoggingEvent loggingEvent) { - StringWriter sw = new StringWriter(Global.LogMessages); - Layout.Format(sw, loggingEvent); - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Code/Utilities.cs b/samples/OAuthServiceProvider/Code/Utilities.cs deleted file mode 100644 index a225650..0000000 --- a/samples/OAuthServiceProvider/Code/Utilities.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Security.Principal; - using System.Web; - - /// <summary> - /// Extension methods and other helpful utility methods. - /// </summary> - public static class Utilities { - /// <summary> - /// Gets the database entity representing the user identified by a given <see cref="IIdentity"/> instance. - /// </summary> - /// <param name="identity">The identity of the user.</param> - /// <returns> - /// The database object for that user; or <c>null</c> if the user could not - /// be found or if <paramref name="identity"/> is <c>null</c> or represents an anonymous identity. - /// </returns> - public static User GetUser(this IIdentity identity) { - if (identity == null || !identity.IsAuthenticated) { - return null; - } - - return Global.DataContext.Users.SingleOrDefault(user => user.OpenIDClaimedIdentifier == identity.Name); - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/DataApi.cs b/samples/OAuthServiceProvider/DataApi.cs deleted file mode 100644 index 9d531e6..0000000 --- a/samples/OAuthServiceProvider/DataApi.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace OAuthServiceProvider { - using System.Linq; - using System.ServiceModel; - using OAuthServiceProvider.Code; - - /// <summary> - /// The WCF service API. - /// </summary> - /// <remarks> - /// Note how there is no code here that is bound to OAuth or any other - /// credential/authorization scheme. That's all part of the channel/binding elsewhere. - /// And the reference to OperationContext.Current.ServiceSecurityContext.PrimaryIdentity - /// is the user being impersonated by the WCF client. - /// In the OAuth case, it is the user who authorized the OAuth access token that was used - /// to gain access to the service. - /// </remarks> - public class DataApi : IDataApi { - private User User { - get { return OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.GetUser(); } - } - - public int? GetAge() { - return User.Age; - } - - public string GetName() { - return User.FullName; - } - - public string[] GetFavoriteSites() { - return User.FavoriteSites.Select(site => site.SiteUrl).ToArray(); - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/DataApi.svc b/samples/OAuthServiceProvider/DataApi.svc deleted file mode 100644 index 50e952c..0000000 --- a/samples/OAuthServiceProvider/DataApi.svc +++ /dev/null @@ -1 +0,0 @@ -<%@ ServiceHost Language="C#" Debug="true" Service="OAuthServiceProvider.DataApi" CodeBehind="DataApi.cs" %> diff --git a/samples/OAuthServiceProvider/Default.aspx b/samples/OAuthServiceProvider/Default.aspx deleted file mode 100644 index 3e5d820..0000000 --- a/samples/OAuthServiceProvider/Default.aspx +++ /dev/null @@ -1,13 +0,0 @@ -<%@ Page Title="DotNetOpenAuth Service Provider Sample" Language="C#" MasterPageFile="~/MasterPage.master" CodeBehind="~/Default.aspx.cs" Inherits="OAuthServiceProvider._Default" AutoEventWireup="True" %> - -<%@ Import Namespace="System.IO" %> -<%@ Import Namespace="System.Data.SqlClient" %> - -<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server"> - <asp:Button ID="createDatabaseButton" runat="server" Text="(Re)create Database" OnClick="createDatabaseButton_Click" /> - <asp:Label runat="server" ID="databaseStatus" EnableViewState="false" Text="Database recreated!" - Visible="false" /> - <p>Note that to be useful, you really need to either modify the database to add an - account with data that will be accessed by this sample, or modify this very page - to inject that data into the database. </p> -</asp:Content> diff --git a/samples/OAuthServiceProvider/Default.aspx.cs b/samples/OAuthServiceProvider/Default.aspx.cs deleted file mode 100644 index 9193da4..0000000 --- a/samples/OAuthServiceProvider/Default.aspx.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace OAuthServiceProvider { - using System; - using System.Collections.Generic; - using System.Configuration; - using System.IO; - using System.Linq; - using System.Web; - using OAuthServiceProvider.Code; - - public partial class _Default : System.Web.UI.Page { - protected void createDatabaseButton_Click(object sender, EventArgs e) { - string databasePath = Path.Combine(Server.MapPath(Request.ApplicationPath), "App_Data"); - if (!Directory.Exists(databasePath)) { - Directory.CreateDirectory(databasePath); - } - string connectionString = ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString.Replace("|DataDirectory|", databasePath); - var dc = new DataClassesDataContext(connectionString); - if (dc.DatabaseExists()) { - dc.DeleteDatabase(); - } - try { - dc.CreateDatabase(); - - // Fill with sample data. - dc.Clients.InsertOnSubmit(new Client { - ClientIdentifier = "sampleconsumer", - ClientSecret = "samplesecret", - Name = "Some sample client", - }); - dc.Users.InsertOnSubmit(new User { - OpenIDFriendlyIdentifier = "=arnott", - OpenIDClaimedIdentifier = "=!9B72.7DD1.50A9.5CCD", - Age = 27, - FullName = "Andrew Arnott", - FavoriteSites = new System.Data.Linq.EntitySet<FavoriteSite> { - new FavoriteSite { SiteUrl = "http://www.microsoft.com" }, - new FavoriteSite { SiteUrl = "http://www.google.com" }, - }, - }); - - dc.SubmitChanges(); - this.databaseStatus.Visible = true; - } catch (System.Data.SqlClient.SqlException ex) { - foreach (System.Data.SqlClient.SqlError error in ex.Errors) { - Response.Write(error.Message); - } - } - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Default.aspx.designer.cs b/samples/OAuthServiceProvider/Default.aspx.designer.cs deleted file mode 100644 index afa79c0..0000000 --- a/samples/OAuthServiceProvider/Default.aspx.designer.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace OAuthServiceProvider { - - - public partial class _Default { - - /// <summary> - /// createDatabaseButton control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Button createDatabaseButton; - - /// <summary> - /// databaseStatus control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label databaseStatus; - } -} diff --git a/samples/OAuthServiceProvider/Global.asax b/samples/OAuthServiceProvider/Global.asax deleted file mode 100644 index 3007bd3..0000000 --- a/samples/OAuthServiceProvider/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Inherits="OAuthServiceProvider.Code.Global" CodeBehind="Code\Global.cs" %>
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Login.aspx b/samples/OAuthServiceProvider/Login.aspx deleted file mode 100644 index fd858c8..0000000 --- a/samples/OAuthServiceProvider/Login.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Title="Login" Language="C#" MasterPageFile="~/MasterPage.master" %> - -<%@ Register Assembly="DotNetOpenAuth" Namespace="DotNetOpenAuth.OpenId.RelyingParty" TagPrefix="rp" %> -<script runat="server"> - protected void Page_Load(object sender, EventArgs e) { - OpenIdLogin1.Focus(); - } -</script> -<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server"> - <rp:OpenIdLogin runat="server" TabIndex='1' ID="OpenIdLogin1" /> -</asp:Content> diff --git a/samples/OAuthServiceProvider/MasterPage.master b/samples/OAuthServiceProvider/MasterPage.master deleted file mode 100644 index 136dfc9..0000000 --- a/samples/OAuthServiceProvider/MasterPage.master +++ /dev/null @@ -1,23 +0,0 @@ -<%@ Master Language="C#" %> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<script runat="server"> - -</script> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head runat="server"> - <title>DotNetOpenAuth Service Provider sample</title> - <asp:ContentPlaceHolder ID="head" runat="server"/> -</head> -<body> - <form id="form1" runat="server"> - <h1>DotNetOpenAuth Service Provider sample</h1> - <div> - <asp:ContentPlaceHolder ID="Body" runat="server"> - </asp:ContentPlaceHolder> - </div> - </form> -</body> -</html> diff --git a/samples/OAuthServiceProvider/Members/Authorize.aspx b/samples/OAuthServiceProvider/Members/Authorize.aspx deleted file mode 100644 index 71c538a..0000000 --- a/samples/OAuthServiceProvider/Members/Authorize.aspx +++ /dev/null @@ -1,53 +0,0 @@ -<%@ Page Title="Authorize Access" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" - CodeBehind="Authorize.aspx.cs" Inherits="OAuthServiceProvider.Members.Authorize2" %> - -<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server"> - <asp:MultiView runat="server" ActiveViewIndex="0" ID="multiView"> - <asp:View ID="AuthRequest" runat="server"> - <div style="background-color: Yellow"> - <b>Warning</b>: Never give your login credentials to another web site or application. - </div> - <asp:HiddenField runat="server" ID="OAuthAuthorizationSecToken" EnableViewState="false" /> - <p>The client web site or application <asp:Label ID="consumerLabel" Font-Bold="true" - runat="server" Text="[consumer]" /> wants access to your <asp:Label ID="desiredAccessLabel" - Font-Bold="true" runat="server" Text="[protected resource]" />. </p> - <p>Do you want to allow this? </p> - <div style="display: none" id="responseButtonsDiv"> - <asp:Button ID="allowAccessButton" runat="server" Text="Yes" OnClick="allowAccessButton_Click" /> - <asp:Button ID="denyAccessButton" runat="server" Text="No" OnClick="denyAccessButton_Click" /> - </div> - <div id="javascriptDisabled"> - <b>JavaScript appears to be disabled in your browser. </b>This page requires Javascript - to be enabled to better protect your security. - </div> - <p>If you grant access now, you can revoke it at any time by returning to this page. - </p> - <script language="javascript" type="text/javascript"> - //<![CDATA[ - // we use HTML to hide the action buttons and JavaScript to show them - // to protect against click-jacking in an iframe whose JavaScript is disabled. - document.getElementById('responseButtonsDiv').style.display = 'block'; - document.getElementById('javascriptDisabled').style.display = 'none'; - - // Frame busting code (to protect us from being hosted in an iframe). - // This protects us from click-jacking. - if (document.location !== window.top.location) { - window.top.location = document.location; - } - //]]> - </script> - </asp:View> - <asp:View ID="AuthGranted" runat="server"> - <p>Authorization has been granted.</p> - <asp:MultiView runat="server" ID="verifierMultiView" ActiveViewIndex="0"> - <asp:View ID="View3" runat="server"> - <p>You must enter this verification code at the Consumer: <asp:Label runat="server" - ID="verificationCodeLabel" /> </p> - </asp:View> - <asp:View ID="View4" runat="server"> - <p>You may now close this window and return to the Consumer. </p> - </asp:View> - </asp:MultiView> - </asp:View> - </asp:MultiView> -</asp:Content> diff --git a/samples/OAuthServiceProvider/Members/Authorize.aspx.cs b/samples/OAuthServiceProvider/Members/Authorize.aspx.cs deleted file mode 100644 index 4cb266f..0000000 --- a/samples/OAuthServiceProvider/Members/Authorize.aspx.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace OAuthServiceProvider.Members { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Security.Cryptography; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - using Code; - - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth2; - using DotNetOpenAuth.OAuth2.Messages; - - public partial class Authorize2 : System.Web.UI.Page { - private static readonly RandomNumberGenerator CryptoRandomDataGenerator = new RNGCryptoServiceProvider(); - - private EndUserAuthorizationRequest pendingRequest; - - private Client client; - - private string AuthorizationSecret { - get { return Session["OAuthAuthorizationSecret"] as string; } - set { Session["OAuthAuthorizationSecret"] = value; } - } - - protected void Page_Load(object sender, EventArgs e) { - var getRequest = new HttpRequestInfo("GET", this.Request.Url, this.Request.RawUrl, new WebHeaderCollection(), null); - this.pendingRequest = Global.AuthorizationServer.ReadAuthorizationRequest(getRequest); - if (this.pendingRequest == null) { - throw new HttpException((int)HttpStatusCode.BadRequest, "Missing authorization request."); - } - - this.client = Global.DataContext.Clients.First(c => c.ClientIdentifier == this.pendingRequest.ClientIdentifier); - - var authServer = new OAuth2AuthorizationServer(); - if (authServer.CanBeAutoApproved(this.pendingRequest)) { - Global.AuthorizationServer.ApproveAuthorizationRequest(this.pendingRequest, User.Identity.Name); - } - - if (!IsPostBack) { - this.desiredAccessLabel.Text = OAuthUtilities.JoinScopes(this.pendingRequest.Scope); - this.consumerLabel.Text = this.client.Name; - - // Generate an unpredictable secret that goes to the user agent and must come back - // with authorization to guarantee the user interacted with this page rather than - // being scripted by an evil Consumer. - var randomData = new byte[8]; - CryptoRandomDataGenerator.GetBytes(randomData); - this.AuthorizationSecret = Convert.ToBase64String(randomData); - this.OAuthAuthorizationSecToken.Value = this.AuthorizationSecret; - } - } - - protected void allowAccessButton_Click(object sender, EventArgs e) { - if (this.AuthorizationSecret != this.OAuthAuthorizationSecToken.Value) { - throw new ArgumentException(); // probably someone trying to hack in. - } - this.AuthorizationSecret = null; // clear one time use secret - this.multiView.SetActiveView(this.AuthGranted); - - this.client.ClientAuthorizations.Add( - new ClientAuthorization { - Scope = OAuthUtilities.JoinScopes(this.pendingRequest.Scope), - User = Global.LoggedInUser, - CreatedOnUtc = DateTime.UtcNow, - }); - Global.AuthorizationServer.ApproveAuthorizationRequest(this.pendingRequest, User.Identity.Name); - } - - protected void denyAccessButton_Click(object sender, EventArgs e) { - Global.AuthorizationServer.RejectAuthorizationRequest(this.pendingRequest); - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Members/Authorize.aspx.designer.cs b/samples/OAuthServiceProvider/Members/Authorize.aspx.designer.cs deleted file mode 100644 index db39669..0000000 --- a/samples/OAuthServiceProvider/Members/Authorize.aspx.designer.cs +++ /dev/null @@ -1,123 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace OAuthServiceProvider.Members { - - - public partial class Authorize2 { - - /// <summary> - /// multiView control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.MultiView multiView; - - /// <summary> - /// AuthRequest control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.View AuthRequest; - - /// <summary> - /// OAuthAuthorizationSecToken control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.HiddenField OAuthAuthorizationSecToken; - - /// <summary> - /// consumerLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label consumerLabel; - - /// <summary> - /// desiredAccessLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label desiredAccessLabel; - - /// <summary> - /// allowAccessButton control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Button allowAccessButton; - - /// <summary> - /// denyAccessButton control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Button denyAccessButton; - - /// <summary> - /// AuthGranted control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.View AuthGranted; - - /// <summary> - /// verifierMultiView control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.MultiView verifierMultiView; - - /// <summary> - /// View3 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.View View3; - - /// <summary> - /// verificationCodeLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label verificationCodeLabel; - - /// <summary> - /// View4 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.View View4; - } -} diff --git a/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx b/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx deleted file mode 100644 index 3506eb9..0000000 --- a/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx +++ /dev/null @@ -1,6 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="OAuthServiceProvider.AuthorizedConsumers" Codebehind="AuthorizedConsumers.aspx.cs" %> - -<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server"> - <h2>The following consumers have access to your data</h2> - <p>TODO</p> -</asp:Content> diff --git a/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx.cs b/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx.cs deleted file mode 100644 index fe647a8..0000000 --- a/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace OAuthServiceProvider { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - - /// <summary> - /// Lists the consumers that have active request or access tokens - /// and provides a mechanism for the user to revoke permissions. - /// </summary> - public partial class AuthorizedConsumers : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx.designer.cs b/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx.designer.cs deleted file mode 100644 index 419c114..0000000 --- a/samples/OAuthServiceProvider/Members/AuthorizedConsumers.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace OAuthServiceProvider { - - - public partial class AuthorizedConsumers { - } -} diff --git a/samples/OAuthServiceProvider/Members/Logoff.aspx b/samples/OAuthServiceProvider/Members/Logoff.aspx deleted file mode 100644 index afa9dd9..0000000 --- a/samples/OAuthServiceProvider/Members/Logoff.aspx +++ /dev/null @@ -1,8 +0,0 @@ -<%@ Page Title="Log off" Language="C#" MasterPageFile="~/MasterPage.master" %> - -<script runat="server"> - private void Page_Load(object sender, EventArgs e) { - FormsAuthentication.SignOut(); - Response.Redirect("~/"); - } -</script> diff --git a/samples/OAuthServiceProvider/Members/Web.config b/samples/OAuthServiceProvider/Members/Web.config deleted file mode 100644 index 50fab27..0000000 --- a/samples/OAuthServiceProvider/Members/Web.config +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0"?> -<configuration> - <system.web> - <authorization> - <deny users="?"/> - </authorization> - </system.web> -</configuration> diff --git a/samples/OAuthServiceProvider/OAuth.ashx b/samples/OAuthServiceProvider/OAuth.ashx deleted file mode 100644 index d450ead..0000000 --- a/samples/OAuthServiceProvider/OAuth.ashx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebHandler Language="C#" CodeBehind="OAuth.ashx.cs" Class="OAuthServiceProvider.OAuth" %> diff --git a/samples/OAuthServiceProvider/OAuth.ashx.cs b/samples/OAuthServiceProvider/OAuth.ashx.cs deleted file mode 100644 index b7880c9..0000000 --- a/samples/OAuthServiceProvider/OAuth.ashx.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace OAuthServiceProvider { - using System.Web; - using System.Web.SessionState; - using Code; - using DotNetOpenAuth.Messaging; - - public class OAuth : IHttpHandler, IRequiresSessionState { - /// <summary> - /// Gets a value indicating whether another request can use the <see cref="T:System.Web.IHttpHandler"/> instance. - /// </summary> - /// <value>Always <c>true</c></value> - /// <returns>true if the <see cref="T:System.Web.IHttpHandler"/> instance is reusable; otherwise, false. - /// </returns> - public bool IsReusable { - get { return true; } - } - - /// <summary> - /// Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler"/> interface. - /// </summary> - /// <param name="context">An <see cref="T:System.Web.HttpContext"/> object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests.</param> - public void ProcessRequest(HttpContext context) { - IDirectResponseProtocolMessage response; - if (Global.AuthorizationServer.TryPrepareAccessTokenResponse(out response)) { - Global.AuthorizationServer.Channel.Send(response); - } - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/OAuthServiceProvider.csproj b/samples/OAuthServiceProvider/OAuthServiceProvider.csproj deleted file mode 100644 index 2046c9b..0000000 --- a/samples/OAuthServiceProvider/OAuthServiceProvider.csproj +++ /dev/null @@ -1,177 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion> - </ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{E135F455-0669-49F8-9207-07FCA8C8FC79}</ProjectGuid> - <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>OAuthServiceProvider</RootNamespace> - <AssemblyName>OAuthServiceProvider</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\</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\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="log4net"> - <HintPath>..\..\lib\log4net.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Core" /> - <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="System.Data.Linq" /> - <Reference Include="System.IdentityModel" /> - <Reference Include="System.ServiceModel" /> - <Reference Include="System.Web.Extensions" /> - <Reference Include="System.Xml.Linq" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Web" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Configuration" /> - <Reference Include="System.Web.Services" /> - <Reference Include="System.EnterpriseServices" /> - <Reference Include="System.Web.Mobile" /> - </ItemGroup> - <ItemGroup> - <Content Include="DataApi.svc" /> - <Content Include="Default.aspx" /> - <Content Include="favicon.ico" /> - <Content Include="Global.asax" /> - <Content Include="Login.aspx" /> - <Content Include="Members\Authorize.aspx" /> - <Content Include="Members\AuthorizedConsumers.aspx" /> - <Content Include="Members\Logoff.aspx" /> - <Content Include="TracePage.aspx" /> - <Content Include="Web.config" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Code\DatabaseNonceStore.cs" /> - <Compile Include="Code\OAuth2AuthorizationServer.cs" /> - <Compile Include="Default.aspx.designer.cs"> - <DependentUpon>Default.aspx</DependentUpon> - </Compile> - <Compile Include="Members\Authorize.aspx.cs"> - <DependentUpon>Authorize.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Members\Authorize.aspx.designer.cs"> - <DependentUpon>Authorize.aspx</DependentUpon> - </Compile> - <Compile Include="OAuth.ashx.cs"> - <DependentUpon>OAuth.ashx</DependentUpon> - </Compile> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="DataApi.cs"> - <DependentUpon>DataApi.svc</DependentUpon> - </Compile> - <Compile Include="Members\AuthorizedConsumers.aspx.designer.cs"> - <DependentUpon>AuthorizedConsumers.aspx</DependentUpon> - </Compile> - <Compile Include="Code\Global.cs" /> - <Compile Include="Code\IDataApi.cs" /> - <Compile Include="Code\OAuthAuthorizationManager.cs" /> - <Compile Include="Code\Client.cs" /> - <Compile Include="Code\OAuthPrincipalAuthorizationPolicy.cs" /> - <Compile Include="Code\TracePageAppender.cs" /> - <Compile Include="Code\Utilities.cs" /> - <Compile Include="Code\DataClasses.designer.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>DataClasses.dbml</DependentUpon> - </Compile> - <Compile Include="Default.aspx.cs"> - <DependentUpon>Default.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Members\AuthorizedConsumers.aspx.cs"> - <DependentUpon>AuthorizedConsumers.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="TracePage.aspx.cs"> - <DependentUpon>TracePage.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="TracePage.aspx.designer.cs"> - <DependentUpon>TracePage.aspx</DependentUpon> - </Compile> - </ItemGroup> - <ItemGroup> - <Folder Include="App_Data\" /> - </ItemGroup> - <ItemGroup> - <Content Include="MasterPage.master" /> - </ItemGroup> - <ItemGroup> - <None Include="Code\DataClasses.dbml"> - <Generator>MSLinqToSQLGenerator</Generator> - <LastGenOutput>DataClasses.designer.cs</LastGenOutput> - <SubType>Designer</SubType> - </None> - <Content Include="Members\Web.config" /> - <Content Include="OAuth.ashx" /> - </ItemGroup> - <ItemGroup> - <None Include="Code\DataClasses.dbml.layout"> - <DependentUpon>DataClasses.dbml</DependentUpon> - </None> - </ItemGroup> - <ItemGroup> - <Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\src\DotNetOpenAuth\DotNetOpenAuth.csproj"> - <Project>{3191B653-F76D-4C1A-9A5A-347BC3AAAAB7}</Project> - <Name>DotNetOpenAuth</Name> - </ProjectReference> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> - <WebProjectProperties> - <UseIIS>False</UseIIS> - <AutoAssignPort>False</AutoAssignPort> - <DevelopmentServerPort>65169</DevelopmentServerPort> - <DevelopmentServerVPath>/</DevelopmentServerVPath> - <IISUrl> - </IISUrl> - <NTLMAuthentication>False</NTLMAuthentication> - <UseCustomServer>False</UseCustomServer> - <CustomServerUrl> - </CustomServerUrl> - <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> - </WebProjectProperties> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> -</Project>
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Properties/AssemblyInfo.cs b/samples/OAuthServiceProvider/Properties/AssemblyInfo.cs deleted file mode 100644 index 09d299c..0000000 --- a/samples/OAuthServiceProvider/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -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("OAuthServiceProvider")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OAuthServiceProvider")] -[assembly: AssemblyCopyright("Copyright © 2010")] -[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("B6206451-6557-4568-8D25-84AF93EC8B7B")] - -// 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 Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/OAuthServiceProvider/Settings.StyleCop b/samples/OAuthServiceProvider/Settings.StyleCop deleted file mode 100644 index 7f55ce6..0000000 --- a/samples/OAuthServiceProvider/Settings.StyleCop +++ /dev/null @@ -1 +0,0 @@ -<StyleCopSettings Version="4.3" />
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/TracePage.aspx b/samples/OAuthServiceProvider/TracePage.aspx deleted file mode 100644 index e83adc3..0000000 --- a/samples/OAuthServiceProvider/TracePage.aspx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" Inherits="OAuthServiceProvider.TracePage" Codebehind="TracePage.aspx.cs" %> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head runat="server"> - <title></title> -</head> -<body> - <form id="form1" runat="server"> - <p align="right"> - <asp:Button runat="server" Text="Clear log" ID="clearLogButton" OnClick="clearLogButton_Click" /> - </p> - <pre> - <asp:PlaceHolder runat="server" ID="placeHolder1" /> - </pre> - </form> -</body> -</html> diff --git a/samples/OAuthServiceProvider/TracePage.aspx.cs b/samples/OAuthServiceProvider/TracePage.aspx.cs deleted file mode 100644 index fcfade5..0000000 --- a/samples/OAuthServiceProvider/TracePage.aspx.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace OAuthServiceProvider { - using System; - using System.Collections.Generic; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - using OAuthServiceProvider.Code; - - /// <summary> - /// A page to display recent log messages. - /// </summary> - public partial class TracePage : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - this.placeHolder1.Controls.Add(new Label { Text = HttpUtility.HtmlEncode(Global.LogMessages.ToString()) }); - } - - protected void clearLogButton_Click(object sender, EventArgs e) { - Global.LogMessages.Length = 0; - - // clear the page immediately, and allow for F5 without a Postback warning. - Response.Redirect(Request.Url.AbsoluteUri); - } - } -}
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/TracePage.aspx.designer.cs b/samples/OAuthServiceProvider/TracePage.aspx.designer.cs deleted file mode 100644 index 3cd04be..0000000 --- a/samples/OAuthServiceProvider/TracePage.aspx.designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace OAuthServiceProvider { - - - public partial class TracePage { - - /// <summary> - /// form1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// <summary> - /// clearLogButton control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Button clearLogButton; - - /// <summary> - /// placeHolder1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.PlaceHolder placeHolder1; - } -} diff --git a/samples/OAuthServiceProvider/Web.config b/samples/OAuthServiceProvider/Web.config deleted file mode 100644 index fbab32e..0000000 --- a/samples/OAuthServiceProvider/Web.config +++ /dev/null @@ -1,172 +0,0 @@ -<?xml version="1.0"?> -<configuration> - <configSections> - <section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> - <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler" requirePermission="false"/> - <section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true"/> - <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> - <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> - <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> - <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> - <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> - <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> - <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> - <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> - </sectionGroup> - </sectionGroup> - </sectionGroup> - </configSections> - - <!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names), - which is necessary for OpenID urls with unicode characters in the domain/host name. - It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. --> - <uri> - <idn enabled="All"/> - <iriParsing enabled="true"/> - </uri> - - <system.net> - <defaultProxy enabled="true" /> - <settings> - <!-- This setting causes .NET to check certificate revocation lists (CRL) - before trusting HTTPS certificates. But this setting tends to not - be allowed in shared hosting environments. --> - <!--<servicePointManager checkCertificateRevocationList="true"/>--> - </settings> - </system.net> - - <!-- this is an optional configuration section where aspects of dotnetopenauth can be customized --> - <dotNetOpenAuth> - <!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. --> - <reporting enabled="true" /> - - <!-- Relaxing SSL requirements is useful for simple samples, but NOT a good idea in production. --> - <messaging relaxSslRequirements="true" /> - </dotNetOpenAuth> - - <appSettings/> - <connectionStrings> - <add name="DatabaseConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database3.mdf;Integrated Security=True;User Instance=True" - providerName="System.Data.SqlClient" /> - </connectionStrings> - - <system.web> - <!-- - Set compilation debug="true" to insert debugging - symbols into the compiled page. Because this - affects performance, set this value to true only - during development. - --> - <compilation debug="true"> - <assemblies> - <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> - <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> - <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> - <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> - <remove assembly="DotNetOpenAuth.Contracts"/> - </assemblies> - </compilation> - <authentication mode="Forms"> - <forms name="oauthSP" /> - </authentication> - <pages> - <controls> - <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - </controls> - </pages> - <httpHandlers> - <remove verb="*" path="*.asmx"/> - <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> - </httpHandlers> - <httpModules> - <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - </httpModules> - </system.web> - <system.codedom> - <compilers> - <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <providerOption name="CompilerVersion" value="v3.5"/> - <providerOption name="WarnAsError" value="false"/> - </compiler> - <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <providerOption name="CompilerVersion" value="v3.5"/> - <providerOption name="OptionInfer" value="true"/> - <providerOption name="WarnAsError" value="false"/> - </compiler> - </compilers> - </system.codedom> - <!-- - The system.webServer section is required for running ASP.NET AJAX under Internet - Information Services 7.0. It is not necessary for previous version of IIS. - --> - <system.webServer> - <validation validateIntegratedModeConfiguration="false"/> - <modules> - <remove name="ScriptModule"/> - <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - </modules> - <handlers> - <remove name="WebServiceHandlerFactory-Integrated"/> - <remove name="ScriptHandlerFactory"/> - <remove name="ScriptHandlerFactoryAppServices"/> - <remove name="ScriptResource"/> - <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - </handlers> - </system.webServer> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> - <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> - <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> - </dependentAssembly> - </assemblyBinding> - </runtime> - <log4net> - <appender name="TracePageAppender" type="OAuthServiceProvider.Code.TracePageAppender, OAuthServiceProvider"> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%date (GMT%date{%z}) [%thread] %-5level %logger - %message%newline"/> - </layout> - </appender> - <!-- Setup the root category, add the appenders and set the default level --> - <root> - <level value="INFO"/> - <!--<appender-ref ref="RollingFileAppender" />--> - <appender-ref ref="TracePageAppender"/> - </root> - <!-- Specify the level for some specific categories --> - <logger name="DotNetOpenAuth"> - <level value="ALL"/> - </logger> - </log4net> - <system.serviceModel> - <behaviors> - <serviceBehaviors> - <behavior name="DataApiBehavior"> - <serviceMetadata httpGetEnabled="true"/> - <serviceDebug includeExceptionDetailInFaults="true"/> - <serviceAuthorization serviceAuthorizationManagerType="OAuthServiceProvider.Code.OAuthAuthorizationManager, OAuthServiceProvider" principalPermissionMode="Custom"/> - </behavior> - </serviceBehaviors> - </behaviors> - <services> - <service behaviorConfiguration="DataApiBehavior" name="OAuthServiceProvider.DataApi"> - <endpoint address="" binding="wsHttpBinding" contract="OAuthServiceProvider.Code.IDataApi"> - <identity> - <dns value="localhost"/> - </identity> - </endpoint> - <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> - </service> - </services> - </system.serviceModel> -</configuration> diff --git a/samples/OAuthServiceProvider/favicon.ico b/samples/OAuthServiceProvider/favicon.ico Binary files differdeleted file mode 100644 index e227dbe..0000000 --- a/samples/OAuthServiceProvider/favicon.ico +++ /dev/null |