diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2010-04-19 07:09:32 -0400 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2010-04-19 07:09:32 -0400 |
commit | 668c50fd19dc633bd367ac8ace37df8b5f9a5881 (patch) | |
tree | 8ab71b553fa22e12aae6817b3c6fab93acdd31df /samples/OAuthServiceProvider/DataApi.cs | |
parent | fef932af78eac2b775452c4a851e84a813027548 (diff) | |
download | DotNetOpenAuth-668c50fd19dc633bd367ac8ace37df8b5f9a5881.zip DotNetOpenAuth-668c50fd19dc633bd367ac8ace37df8b5f9a5881.tar.gz DotNetOpenAuth-668c50fd19dc633bd367ac8ace37df8b5f9a5881.tar.bz2 |
Updated OAuth C and SP samples to use standard WAP namespaces.
Diffstat (limited to 'samples/OAuthServiceProvider/DataApi.cs')
-rw-r--r-- | samples/OAuthServiceProvider/DataApi.cs | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/samples/OAuthServiceProvider/DataApi.cs b/samples/OAuthServiceProvider/DataApi.cs index d5adb10..9d531e6 100644 --- a/samples/OAuthServiceProvider/DataApi.cs +++ b/samples/OAuthServiceProvider/DataApi.cs @@ -1,31 +1,34 @@ -using System.Linq; -using System.ServiceModel; +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(); } - } + /// <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 int? GetAge() { + return User.Age; + } - public string GetName() { - return User.FullName; - } + public string GetName() { + return User.FullName; + } - public string[] GetFavoriteSites() { - return User.FavoriteSites.Select(site => site.SiteUrl).ToArray(); + public string[] GetFavoriteSites() { + return User.FavoriteSites.Select(site => site.SiteUrl).ToArray(); + } } -} +}
\ No newline at end of file |