![]() |
|
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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=?= |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
![]() |
| Thread Tools | Search this Thread |
|
|