diff options
Diffstat (limited to 'samples/ServiceProvider/App_Code/DataApi.cs')
-rw-r--r-- | samples/ServiceProvider/App_Code/DataApi.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/samples/ServiceProvider/App_Code/DataApi.cs b/samples/ServiceProvider/App_Code/DataApi.cs index 1a7555c..43f402a 100644 --- a/samples/ServiceProvider/App_Code/DataApi.cs +++ b/samples/ServiceProvider/App_Code/DataApi.cs @@ -1,14 +1,17 @@ -using System.Globalization;
+using System.Linq;
+using System.Globalization;
using System.ServiceModel;
public class DataApi : IDataApi {
- public int GetAge() {
- return 5;
+ public int? GetAge() {
+ return AccessToken.User.Age;
}
public string GetName() {
- 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));
+ return AccessToken.User.FullName;
+ }
+
+ private static OAuthToken AccessToken {
+ get { return OperationContext.Current.IncomingMessageProperties["OAuthAccessToken"] as OAuthToken; }
}
}
|