Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Feature Request: Enchance IUserIdentity #1954

Closed
ravensorb opened this issue Jun 7, 2015 · 5 comments
Closed

Feature Request: Enchance IUserIdentity #1954

ravensorb opened this issue Jun 7, 2015 · 5 comments

Comments

@ravensorb
Copy link

Any thought to including a basic Dictionary to the IUserIdentity to allow providers to include a little extra detail if they want. For example, it would be nice to be able to have a place to store an internal userID, lastLogon, or the users email address.

I know that I can do this when I implement my own IUserIdentity -- the issue is I need to cast from IUserIdentity to my custom implementation if I do that which is not ideal.

@horsdal
Copy link
Member

horsdal commented Jun 16, 2015

The user and identity stuff has gotten an overhaul for upcoming 2.0, where it uses ClaimsPrincipal and friends. You can see the 2.0 code in the v2 branch (https://github.com/NancyFx/Nancy/tree/v2) and the claims code in particular in PR #1820
Maybe that will help you (once 2.0 is out, that is)?

@dealproc
Copy link

In the meantime, @damianh offered an MSOwin set of extensions that could potentially be utilized, if you're willing to abandon using the default nancy bits for authentication/authorization. It's been working pretty well thus far.

@ravensorb
Copy link
Author

I like where 2.0 is going -- assuming that ClaimsIdentity will also be full supported in the pipeline. That said, I still think it would be nice to allow for either defining a generic that could be used to store a user context (that was serializable) or provide a simple string based dictionary/hashtable concept. Consider how the ASP.NET Authentication/Authorization pipeline has evolved to be more extensible in this area (note I am not prompted the ASP.NET auth pipeline as a whole due - just how it evolved to allow for a generic T to be used to store pertinent user properties).

this could probably be handled by allow for a custom ClaimIdentiy to be created and leveraged within the pipeline -- ex: I could derive from WindowsIdentiy (if I wanted to), and extend it with a few extra properties.

@ravensorb
Copy link
Author

Out of curiosity, how is v2 going? I was looking at the branch and it seems like there have been no commits since march.

@damianh
Copy link
Member

damianh commented Dec 7, 2015

Replaces with ClaimsPrincipal via #1820

@damianh damianh closed this as completed Dec 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants