summaryrefslogtreecommitdiffstats
path: root/samples/OAuthServiceProvider/App_Code/DataApi.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-06-25 19:51:02 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-06-25 19:51:02 -0700
commit3b2fe4819cf449d1ab88178d055239c64b3cfd5e (patch)
treee191391cc71af22a854a06fee0079dbb74405752 /samples/OAuthServiceProvider/App_Code/DataApi.cs
parent97e3fc44a6911289baf3435febc0b003e56ad4e8 (diff)
parentf3ce247dfaa965011c7f8417d00e0fa3dfad4a35 (diff)
downloadDotNetOpenAuth-3b2fe4819cf449d1ab88178d055239c64b3cfd5e.zip
DotNetOpenAuth-3b2fe4819cf449d1ab88178d055239c64b3cfd5e.tar.gz
DotNetOpenAuth-3b2fe4819cf449d1ab88178d055239c64b3cfd5e.tar.bz2
Merge branch 'master' into contracts
Conflicts: src/DotNetOpenAuth.vsmdi src/DotNetOpenAuth/Configuration/TypeConfigurationCollection.cs src/DotNetOpenAuth/Configuration/TypeConfigurationElement.cs src/DotNetOpenAuth/DotNetOpenAuth.csproj src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs src/DotNetOpenAuth/Messaging/Reflection/ValueMapping.cs src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs src/DotNetOpenAuth/OAuth/ConsumerBase.cs src/DotNetOpenAuth/OAuth/Messages/MessageBase.cs src/DotNetOpenAuth/OAuth/Messages/UnauthorizedTokenResponse.cs src/DotNetOpenAuth/OAuth/ServiceProvider.cs src/DotNetOpenAuth/OpenId/Protocol.cs src/DotNetOpenAuth/OpenId/Provider/AutoResponsiveRequest.cs src/DotNetOpenAuth/OpenId/Provider/HostProcessedRequest.cs src/DotNetOpenAuth/OpenId/Provider/IHostProcessedRequest.cs src/DotNetOpenAuth/OpenId/Provider/Request.cs src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs src/DotNetOpenAuth/OpenId/RelyingParty/ServiceEndpoint.cs
Diffstat (limited to 'samples/OAuthServiceProvider/App_Code/DataApi.cs')
-rw-r--r--samples/OAuthServiceProvider/App_Code/DataApi.cs20
1 files changed, 13 insertions, 7 deletions
diff --git a/samples/OAuthServiceProvider/App_Code/DataApi.cs b/samples/OAuthServiceProvider/App_Code/DataApi.cs
index a765159..00876f6 100644
--- a/samples/OAuthServiceProvider/App_Code/DataApi.cs
+++ b/samples/OAuthServiceProvider/App_Code/DataApi.cs
@@ -1,20 +1,26 @@
using System.Linq;
using System.ServiceModel;
+/// <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 Global.LoggedInUser 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 static OAuthToken AccessToken {
- get { return OperationContext.Current.IncomingMessageProperties["OAuthAccessToken"] as OAuthToken; }
- }
-
public int? GetAge() {
- return AccessToken.User.Age;
+ return Global.LoggedInUser.Age;
}
public string GetName() {
- return AccessToken.User.FullName;
+ return Global.LoggedInUser.FullName;
}
public string[] GetFavoriteSites() {
- return AccessToken.User.FavoriteSites.Select(site => site.SiteUrl).ToArray();
+ return Global.LoggedInUser.FavoriteSites.Select(site => site.SiteUrl).ToArray();
}
}