Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Extending IIdentity help

 
Thread Tools Search this Thread
Old 07-19-2006, 07:23 PM   #1
Default Extending IIdentity help


Hi,

I'm attempting to extend IIdentity to enable me to have more
information on the user (email etc) and store it in a cookie. I assume
I am extending the correct object (but if not shout up).

Anyhow I've had a good stab at this, but I don't appear to get my
extended identity back out of the cookie.

At present I'm creating a FormsAuthenticationTicket by decrypting the
cookie and then applying FormsIdentity(ticket) in an attempt to get the
identity. I can't cast this back to my extended identity (only
IIdentity).

I know I'm going wrong. Has anyone a really good example of extending
IIdentity, storing in cookies, retrieving the principal and sending to
the webapp so it can use the user data.

Help as always really appreciated.

Thanks.



Spondishy
  Reply With Quote
Old 07-19-2006, 07:53 PM   #2
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
 
Posts: n/a
Default RE: Extending IIdentity help
Spondishy,
Here is an article that shows how I built a custom Principal class for use
with Windows Forms Authentication and SQLITE database:

http://www.eggheadcafe.com/articles/20041009.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"Spondishy" wrote:

> Hi,
>
> I'm attempting to extend IIdentity to enable me to have more
> information on the user (email etc) and store it in a cookie. I assume
> I am extending the correct object (but if not shout up).
>
> Anyhow I've had a good stab at this, but I don't appear to get my
> extended identity back out of the cookie.
>
> At present I'm creating a FormsAuthenticationTicket by decrypting the
> cookie and then applying FormsIdentity(ticket) in an attempt to get the
> identity. I can't cast this back to my extended identity (only
> IIdentity).
>
> I know I'm going wrong. Has anyone a really good example of extending
> IIdentity, storing in cookies, retrieving the principal and sending to
> the webapp so it can use the user data.
>
> Help as always really appreciated.
>
> Thanks.
>
>



=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
  Reply With Quote
Old 07-19-2006, 09:15 PM   #3
Spondishy
 
Posts: n/a
Default Re: Extending IIdentity help

Peter wrote:

> Spondishy,
> Here is an article that shows how I built a custom Principal class for use
> with Windows Forms Authentication and SQLITE database:
>
> http://www.eggheadcafe.com/articles/20041009.asp
>
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "Spondishy" wrote:
>
> > Hi,
> >
> > I'm attempting to extend IIdentity to enable me to have more
> > information on the user (email etc) and store it in a cookie. I assume
> > I am extending the correct object (but if not shout up).
> >
> > Anyhow I've had a good stab at this, but I don't appear to get my
> > extended identity back out of the cookie.
> >
> > At present I'm creating a FormsAuthenticationTicket by decrypting the
> > cookie and then applying FormsIdentity(ticket) in an attempt to get the
> > identity. I can't cast this back to my extended identity (only
> > IIdentity).
> >
> > I know I'm going wrong. Has anyone a really good example of extending
> > IIdentity, storing in cookies, retrieving the principal and sending to
> > the webapp so it can use the user data.
> >
> > Help as always really appreciated.
> >
> > Thanks.
> >
> >


Thanks Peter,

So, do I take it that IPrincipal is the way to go instead of
IPrincipal?



Spondishy
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46