diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-08-31 22:36:07 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-08-31 22:36:07 -0700 |
commit | 36b1ba3c75d060fa71f6f15582b90e7f70292ddc (patch) | |
tree | dfd32367b587453369a4d58e75482d1a9ca23556 /samples/OAuthServiceProvider/App_Code/DataApi.cs | |
parent | 5ad3b4e1fdc50cbcebfde7fd0f5cd0ef629d874a (diff) | |
parent | 22cd5b99d428271139aa0005d5b3462979cc2720 (diff) | |
download | DotNetOpenAuth-36b1ba3c75d060fa71f6f15582b90e7f70292ddc.zip DotNetOpenAuth-36b1ba3c75d060fa71f6f15582b90e7f70292ddc.tar.gz DotNetOpenAuth-36b1ba3c75d060fa71f6f15582b90e7f70292ddc.tar.bz2 |
Merge branch 'v3.2'
Conflicts:
src/DotNetOpenAuth.vsmdi
src/DotNetOpenAuth/OpenId/Identifier.cs
Diffstat (limited to 'samples/OAuthServiceProvider/App_Code/DataApi.cs')
-rw-r--r-- | samples/OAuthServiceProvider/App_Code/DataApi.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/samples/OAuthServiceProvider/App_Code/DataApi.cs b/samples/OAuthServiceProvider/App_Code/DataApi.cs index 00876f6..d5adb10 100644 --- a/samples/OAuthServiceProvider/App_Code/DataApi.cs +++ b/samples/OAuthServiceProvider/App_Code/DataApi.cs @@ -7,20 +7,25 @@ using System.ServiceModel; /// <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 Global.LoggedInUser is the user being impersonated by the WCF client. +/// 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 Global.LoggedInUser.Age; + return User.Age; } public string GetName() { - return Global.LoggedInUser.FullName; + return User.FullName; } public string[] GetFavoriteSites() { - return Global.LoggedInUser.FavoriteSites.Select(site => site.SiteUrl).ToArray(); + return User.FavoriteSites.Select(site => site.SiteUrl).ToArray(); } } |