Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Nov 22, 2014 @ 13:23
    Warren Buckley
    0

    Is it possible to add extra data or profile info to the backoffice user object?

    Hello all,
    I am working on something currently that is a slight proof of concept but I was wondering is it possible to add extra fields or data onto the backoffice user in anyway at all so I can store a little extra meta info about that user.

    I would need to be able to get & set the value on these extra meta data type fields on the back office user.

    So does anyone know if I can use a fancy method or implement some interface that would allow me to do this at all?

    Cheers,
    Warren

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Nov 22, 2014 @ 13:28
    Warren Buckley
    0

    Just trying to explore around class, objects & methods with Intellisense.
    I see that there is a ProfileData class on the User object. I am curious if I can add to this and add in extra profile data?

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Nov 22, 2014 @ 13:39
    Warren Buckley
    0

    Just reading this back. Maybe I should explain more what I am trying to do so I could get better help rather than being so vague,

    So what I would like to to do is store a JWT (JOT) token against the Umbraco backoffice user (this does not need to be viewable or editable in the Umbraco back office editor or UI). I just need a way or storing a JWT token against a specific Umbraco backoffice user.

    I see that I can in theory store it on the 'Comments' property of the user. However this feels a bit dirty & hacky to do this rather than have a new property on the User object to store this token instead.

    I am not sure if this could be done & if the DB structure for a User/entity is flexible enough for more properties to be added to a user (similar to how an Umbraco member can have more properties, however added via backoffice UI)

    Otherwise my thought is to use PetaPoco to create a new DB table to store the User ID & the token I want to store against them.

    Would love any feedback or thoughts on this please.

    Cheers,
    Warren

  • Anders Bjerner 487 posts 2989 karma points MVP 7x admin c-trib
    Nov 22, 2014 @ 15:55
    Anders Bjerner
    1

    I don't know if there is anything in ASP.NET membership, but one option for a custom solution could be to have a small config file - if you're just going to store the token, you could have a small CSV or XML file specifying the the ID of the user and the token.

    Then load the file on either startup or on changes. If the file is loaded into a Dictionary i C#, you could look up the token of a user without it affecting performance.

    You could then either edit the config file manually or write some code to do it for you.

  • Charles Afford 1163 posts 1709 karma points
    Nov 22, 2014 @ 17:35
    Charles Afford
    1

    Hi Warren,

    Hope UmbUKFest went well :).

    What sort of data are you trying to store against the user and how do you want to retrieve it?

    We had a similar sort of problem i think. What we ended up doing was overriding the membership object to add our own properties on and created a new database table to store the data with the UserId as the key i think it was.

    Created a new membership object, Got the data via a stored proc passing in the UserId to get the data and then just assigned that to our new properties on the membership object.

    I not sure if that is completely correct, but that is essentially what we did :).

    Charlie

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 13, 2015 @ 21:05
    Warren Buckley
    0

    Sorry Charles

    I have been terrible in catching up on forum threads (been going through old bookmarks)

    Do you have an example of this code that you would be happy to share to point me in the right direction?

    I think with Umbraco 7.3 beta & ASP.NET Identity built in for the users/backoffice that I could potentially do this, perhaps?

    Thanks

  • Charles Afford 1163 posts 1709 karma points
    Jul 13, 2015 @ 21:12
    Charles Afford
    0

    No worries, i have not been around here for ages after having my head in Sitecore. Yea i did ASP.net auth from early 6.0 version i believe. I will try and post some code when i get the chance. You can use the api to set the values, remember to have a diffrent Name and Alias as i believe when i had the same Name and Alias it did not work :)

Please Sign in or register to post replies

Write your reply to:

Draft