summaryrefslogtreecommitdiffstats
path: root/samples/OAuthServiceProvider/App_Code/DataApi.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-09-01 17:34:59 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-09-01 17:34:59 -0700
commit6e8a6eb02294c28b13bacaa339e58a67fd766f99 (patch)
treea1bd58a2a51505ba71b697fb61378e7142df8ef3 /samples/OAuthServiceProvider/App_Code/DataApi.cs
parente36299f39476c56977c39700067ed8f6ae0a4e49 (diff)
parent36b1ba3c75d060fa71f6f15582b90e7f70292ddc (diff)
downloadDotNetOpenAuth-6e8a6eb02294c28b13bacaa339e58a67fd766f99.zip
DotNetOpenAuth-6e8a6eb02294c28b13bacaa339e58a67fd766f99.tar.gz
DotNetOpenAuth-6e8a6eb02294c28b13bacaa339e58a67fd766f99.tar.bz2
Merge branch 'master' into contracts
Conflicts: src/DotNetOpenAuth.Test/Mocks/MockIdentifier.cs src/DotNetOpenAuth.Test/OpenId/Provider/OpenIdProviderTests.cs src/DotNetOpenAuth.vsmdi src/DotNetOpenAuth/DotNetOpenAuth.csproj src/DotNetOpenAuth/Messaging/MessageReceivingEndpoint.cs src/DotNetOpenAuth/OAuth/ChannelElements/OAuthServiceProviderMessageFactory.cs src/DotNetOpenAuth/OAuth/Protocol.cs src/DotNetOpenAuth/OAuth/ServiceProvider.cs src/DotNetOpenAuth/OpenId/Association.cs src/DotNetOpenAuth/OpenId/Behaviors/PpidGeneration.cs src/DotNetOpenAuth/OpenId/NoDiscoveryIdentifier.cs src/DotNetOpenAuth/OpenId/Provider/HostProcessedRequest.cs src/DotNetOpenAuth/OpenId/Provider/IDirectedIdentityIdentifierProvider.cs src/DotNetOpenAuth/OpenId/Provider/PrivatePersonalIdentifierProviderBase.cs src/DotNetOpenAuth/OpenId/Realm.cs src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxTextBox.cs src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdTextBox.cs src/DotNetOpenAuth/OpenId/RelyingParty/PositiveAuthenticationResponseSnapshot.cs src/DotNetOpenAuth/OpenId/UriIdentifier.cs src/DotNetOpenAuth/OpenId/XriIdentifier.cs src/DotNetOpenAuth/Util.cs
Diffstat (limited to 'samples/OAuthServiceProvider/App_Code/DataApi.cs')
-rw-r--r--samples/OAuthServiceProvider/App_Code/DataApi.cs13
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();
}
}