From f6177258991eaf807e8cd6eb196537e135ed3ff0 Mon Sep 17 00:00:00 2001 From: ByteBlast Date: Wed, 25 Mar 2015 13:58:09 +0000 Subject: [PATCH] Tweaked context data types. Instead of storing Json as a string, use a JObject. This will make it easier to attain data for the user. --- .../FoursquareAuthenticatedContext.cs | 16 ++++++++-------- ...-OwinOAuthProvidersDemo-20131113093838.mdf | Bin 3211264 -> 3211264 bytes ...nOAuthProvidersDemo-20131113093838_log.ldf | Bin 1048576 -> 1048576 bytes 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Owin.Security.Providers/Foursquare/Provider/FoursquareAuthenticatedContext.cs b/Owin.Security.Providers/Foursquare/Provider/FoursquareAuthenticatedContext.cs index 7454588..6596fba 100644 --- a/Owin.Security.Providers/Foursquare/Provider/FoursquareAuthenticatedContext.cs +++ b/Owin.Security.Providers/Foursquare/Provider/FoursquareAuthenticatedContext.cs @@ -41,15 +41,15 @@ namespace Owin.Security.Providers.Foursquare.Provider this.LastName = TryGetValue(user, "lastName"); this.Name = this.FirstName + " " + this.LastName; this.Gender = TryGetValue(user, "gender"); - this.Photo = TryGetValue(user, "photo"); + this.Photo = (JObject)user["photo"]; this.Friends = TryGetValue(user, "friends"); this.HomeCity = TryGetValue(user, "homeCity"); this.Bio = TryGetValue(user, "bio"); - this.Contact = TryGetValue(user, "contact"); - this.Phone = TryGetValue(JObject.Parse(this.Contact), "phone"); - this.Email = TryGetValue(JObject.Parse(this.Contact), "email"); - this.Twitter = TryGetValue(JObject.Parse(this.Contact), "twitter"); - this.Facebook = TryGetValue(JObject.Parse(this.Contact), "facebook"); + this.Contact = (JObject)user["contact"]; + this.Phone = TryGetValue(Contact, "phone"); + this.Email = TryGetValue(Contact, "email"); + this.Twitter = TryGetValue(Contact, "twitter"); + this.Facebook = TryGetValue(Contact, "facebook"); this.Badges = TryGetValue(user, "badges"); this.Mayorships = TryGetValue(user, "mayorships"); this.Checkins = TryGetValue(user, "checkins"); @@ -93,7 +93,7 @@ namespace Owin.Security.Providers.Foursquare.Provider /// /// Gets the user's photo /// - public string Photo { get; private set; } + public JObject Photo { get; private set; } /// /// Gets the user's friends /// @@ -109,7 +109,7 @@ namespace Owin.Security.Providers.Foursquare.Provider /// /// Gets the user's contact /// - public string Contact { get; private set; } + public JObject Contact { get; private set; } /// /// Gets the user's phone /// diff --git a/OwinOAuthProvidersDemo/App_Data/aspnet-OwinOAuthProvidersDemo-20131113093838.mdf b/OwinOAuthProvidersDemo/App_Data/aspnet-OwinOAuthProvidersDemo-20131113093838.mdf index 9c13e273623639ea9bcecfb4355cbdbc13599d5b..93d2e48cc2b4de74808e50270618c9e798058c12 100644 GIT binary patch delta 327 zcmZ9_zfQtX6vy#Cl0fFmYgYkfqPy z!gFYX-^PRx&pDsroZoPQ;8O;8Q##U#5t-UF=28e|U*+e*G|gv z>3X8&SXybU=)>x={N07v#9K?c>Lnlgo!GVIPw2O2o+F`CN zR8d16XE4x!iE}h@flIWI{_EfhU1(Ua;h={;2DpZc8{Fa!_ZVV?hqdQCeti7`%3@8= delta 329 zcmYMtJx&5q6o%n@t_moM;NXBFa%To~5Pz_shgH~Fum}3FvL?4+0d9b3K}!PFG&FWl z$Oc@2iM|sP_;Q})ik6x5H*f1z0zmO}A5naf^8iJ5O6{a)e5SsE<JBR&?`U_RxS8F=i{M1<-j z_ch;6v{5_njGEwi6G`CS@>uS9LD)VF*&d#ezy};3<6Vij6UVC(%Ix&q;W8?7s4`}& zybJlbN_@bz+EE#jS+IVY`NpvrX{5n6c6Q-lnY8(O(x|{L0#w0T`4a9uFQy@wsznj@ z=}4QO&u_y?l?9GQ2w@wot#pL2Lsnzoa~mnyBgTPeJwRHh>$v0=pAv@!=_%=~GXtj=lIINKSOD zIL@Dnf@GP2;v16e<(<*ok9>>-F59UyPkJqC>a{k_Jf72Bv}wNUqWKwSMSz4yPGv$} z&|Fq&E=IH~w$j@vzYFM6xDXnGxZMUfd7Ma~6CDERQs}B4YLR&Oj@3F$^Gyyfc$J#& z=S+87?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