summaryrefslogtreecommitdiffstats
path: root/samples/ServiceProvider/App_Code/DataApi.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-10-04 22:51:21 -0700
committerAndrew <andrewarnott@gmail.com>2008-10-04 22:51:21 -0700
commit01a2ce0ccba9d8ba9d562d10c22253a7336ccffd (patch)
treeaaec0b6b77442ae3c115b176c4b719c4a5423298 /samples/ServiceProvider/App_Code/DataApi.cs
parentfb668f0e8800e6f507383a4c98e71761280b8898 (diff)
downloadDotNetOpenAuth-01a2ce0ccba9d8ba9d562d10c22253a7336ccffd.zip
DotNetOpenAuth-01a2ce0ccba9d8ba9d562d10c22253a7336ccffd.tar.gz
DotNetOpenAuth-01a2ce0ccba9d8ba9d562d10c22253a7336ccffd.tar.bz2
Added facility so WCF service knows who is calling it.
Diffstat (limited to 'samples/ServiceProvider/App_Code/DataApi.cs')
-rw-r--r--samples/ServiceProvider/App_Code/DataApi.cs10
1 files changed, 4 insertions, 6 deletions
diff --git a/samples/ServiceProvider/App_Code/DataApi.cs b/samples/ServiceProvider/App_Code/DataApi.cs
index 9e679cd..1a7555c 100644
--- a/samples/ServiceProvider/App_Code/DataApi.cs
+++ b/samples/ServiceProvider/App_Code/DataApi.cs
@@ -1,9 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Serialization;
+using System.Globalization;
using System.ServiceModel;
-using System.Text;
public class DataApi : IDataApi {
public int GetAge() {
@@ -11,6 +7,8 @@ public class DataApi : IDataApi {
}
public string GetName() {
- return "Andrew";
+ string consumerKey = OperationContext.Current.IncomingMessageProperties["OAuthConsumerKey"] as string;
+ string accessToken = OperationContext.Current.IncomingMessageProperties["OAuthAccessToken"] as string;
+ return string.Format(CultureInfo.InvariantCulture, "Andrew_{0}_{1}", consumerKey.Substring(0, 1), accessToken.Substring(0, 1));
}
}