Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have an edit profile page where I'm populating the profile fields, (email, name, etc) from a Web API service I've created which looks up the member by the Id.
But this is not secure, you could get at Id's and get data returned.
I can see that a member has a unique key associated with it, and I can get the member from the GetByKey() method.
But how to I get the Key in the first place? I want to use this in the url.
In the backoffice this key is used, but I can't find how this is output.
I'm getting the same problem.
Seems that keys haven't been added to IPublishedContent yet because it breaks backwards compatibility:
Maybe the only way we can get the key is by getting an IMember straight from the database:
var MemberService = UmbracoContext.Current.Application.Services.MemberService;
var memberId = 1234;
var iMember = MemberService.GetById(memberId);
var key = iMember.Key;
We should be able to use the GetKey() when Umbraco 8 comes. I have heard that Umbraco 8 is reimplementing the database cache, so I guess that keys will be added properly then.
I'm doing some work with iMember.Key value which is a GUID, so just out of curiosity where is this value stored in the db...
I opened my umbraco Db.. looked in pretty much every table and I can't find it...
Can anyone shed any light on this?
It's uniqueIdentifier (IIRC) in the umbracoNode table.
In case anyone comes to this issue in Umbraco 8, the below works to get the Guid and Udi of an IPublishedContent:
var publishedCont = Umbraco.ContentAtRoot().First(); //Where Umbraco is the UmbracoHelper
var key = publishedCont.Key;
var udi = Udi.Create("document", key); //either a document, media or member
I don't like manually typing "document", but I can't find a way to get it.
Instead of manually typing the magic string "document" you can use the UdiEntitype and write like this:
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted