Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

UserService/Authentication issues RSS

12 replies

Last post May 14, 2009 11:24 PM by StefanOlson

(0)
  • StefanOlson

    StefanOlson

    Member

    260 Points

    139 Posts

    Re: UserService/Authentication issues

    May 14, 2009 10:29 PM | LINK

    Kyle,

    Firstly, can I request that the next version of the .net RIA services preview provides a virtual Login function?

    I have managed to get it working using the functions you suggested.  Unfortunately I've had to copy out large pieces of code from the AuthenticationBase class because the GetRoles and GetProfile functions are private, so I can't make use of them!

    The full and complete code is available on my blog, for anyone who wishes to use it.

    ...Stefan

    http://www.olsonsoft.com/blogs/stefanolson
  • kylemc

    kylemc

    Contributor

    7243 Points

    1147 Posts

    Microsoft

    Re: UserService/Authentication issues

    May 14, 2009 10:50 PM | LINK

    Thanks for working it through. We definitely plan to open things up a bit more for the next release.

    I guess I was assuming you'd do something like this for GetAuthenticatedUser:

    protected override T GetAuthenticatedUser(IPrincipal principal)
    {
        return base.GetAuthenticatedUser(
            new GenericPrincipal(
                new GenericIdentity(
                    GetUserNameToUse(principal.Identity.Name),
                    principal.Identity.AuthenticationType),
                new string[0]));
    }
    

    There shouldn't be any negative side affects of clearing the roles. Also, I assumed something similar for IssueAuthenticationToken. Thanks for writing about it too. Hopefully it will help anyone trying to accomplish something similar.

    Kyle

  • StefanOlson

    StefanOlson

    Member

    260 Points

    139 Posts

    Re: UserService/Authentication issues

    May 14, 2009 11:24 PM | LINK

    Kyle,

    Thanks for the suggestion!  I've updated my blog post and it now creates the GenericPrincipal in both GetAuthenticatedUser and IssueAuthenticationToken. I didn't realize that there was a GenericIdentity class that I could use for that purpose!

    As I said in my blog post. I'm very impressed with how stable and complete the .net RIA services are already. Keep up the good work!

     ...Stefan

    http://www.olsonsoft.com/blogs/stefanolson