Custom Profile Provider

Discussion in 'ASP .Net Security' started by Weston Weems, Feb 22, 2007.

  1. Weston Weems

    Weston Weems Guest

    Ok, when I first started to play with the Provider model for all things
    membership in ASP.NET 2.0, I have to say I was pleased... but I must
    have missed something here...

    I've got two questions...

    1) I'd like to have profile be a strongly typed complex object derived
    from profilebase. I've edited in web.config to change <provider name=""
    inherits="MyNamespace.CustomProfile">.

    I would like to simply construct this object with my homebrew OR Mapper,
    which I beleive I can get the context (a user id, or a username)

    But the only way I can return data from the ProfileProvider is through a
    collection of name/value pairs? That seems extremely lame.

    Should I just scrap the profiles all together and somehow assign
    equivalent of a profile on Authentication?
    any one have any advice that way? It looks like it was designed to be
    able to use custom strongly typed complex objects, I just don't know how
    to populate the object.

    2) How does one DEBUG a custom profile provider extension? I build both
    the parent web project in debug mode, as well as the custom provider as
    well. When I set a breakpoint and hit start, it'll always say either "No
    symbols loaded for this document" or "There is no executable code at
    this line numbers"

    I want it to break in Initialize() method, when should I expect it to
    break (application start is what I would have guessed)




    Please any input would be greatly appreciated.
    Weston
     
    Weston Weems, Feb 22, 2007
    #1
    1. Advertising

  2. If you derive from ProfileBase and set the inherits in web.config you can
    access the values just using your properties...what's the problem?
    -----
    Dominick Baier (http://www.leastprivilege.com)

    Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

    > Ok, when I first started to play with the Provider model for all
    > things membership in ASP.NET 2.0, I have to say I was pleased... but I
    > must have missed something here...
    >
    > I've got two questions...
    >
    > 1) I'd like to have profile be a strongly typed complex object derived
    > from profilebase. I've edited in web.config to change <provider
    > name="" inherits="MyNamespace.CustomProfile">.
    >
    > I would like to simply construct this object with my homebrew OR
    > Mapper, which I beleive I can get the context (a user id, or a
    > username)
    >
    > But the only way I can return data from the ProfileProvider is through
    > a collection of name/value pairs? That seems extremely lame.
    >
    > Should I just scrap the profiles all together and somehow assign
    > equivalent of a profile on Authentication?
    > any one have any advice that way? It looks like it was designed to be
    > able to use custom strongly typed complex objects, I just don't know
    > how
    > to populate the object.
    > 2) How does one DEBUG a custom profile provider extension? I build
    > both the parent web project in debug mode, as well as the custom
    > provider as well. When I set a breakpoint and hit start, it'll always
    > say either "No symbols loaded for this document" or "There is no
    > executable code at this line numbers"
    >
    > I want it to break in Initialize() method, when should I expect it to
    > break (application start is what I would have guessed)
    >
    > Please any input would be greatly appreciated.
    > Weston
     
    Dominick Baier, Feb 22, 2007
    #2
    1. Advertising

  3. Weston Weems

    Weston Weems Guest

    That side of things is no problem. When I do that, I actually appear to
    be getting out what I expect to when I try Profile.SomeCustomCollection...

    Its the population of that object with real information from my data
    provider.

    Everything wants to be in a namevalue collection. I am curious as to why
    they didnt allow you to return a Profile, eg, they feed you a customer
    id, or custoer name, and expect you to return a Profile object.

    Instead they cripple the provider interface and dont let you get that
    low yourself. The problem is that I want to use my OR mapper to quickly
    load up a CustomProfile object from db, and pass that object back.

    Profile.GetType() already returns CustomProfile, its just empty.

    Weston




    Dominick Baier wrote:
    > If you derive from ProfileBase and set the inherits in web.config you
    > can access the values just using your properties...what's the problem?
    > -----
    > Dominick Baier (http://www.leastprivilege.com)
    >
    > Developing More Secure Microsoft ASP.NET 2.0 Applications
    > (http://www.microsoft.com/mspress/books/9989.asp)
    >
    >> Ok, when I first started to play with the Provider model for all
    >> things membership in ASP.NET 2.0, I have to say I was pleased... but I
    >> must have missed something here...
    >>
    >> I've got two questions...
    >>
    >> 1) I'd like to have profile be a strongly typed complex object derived
    >> from profilebase. I've edited in web.config to change <provider
    >> name="" inherits="MyNamespace.CustomProfile">.
    >>
    >> I would like to simply construct this object with my homebrew OR
    >> Mapper, which I beleive I can get the context (a user id, or a
    >> username)
    >>
    >> But the only way I can return data from the ProfileProvider is through
    >> a collection of name/value pairs? That seems extremely lame.
    >>
    >> Should I just scrap the profiles all together and somehow assign
    >> equivalent of a profile on Authentication?
    >> any one have any advice that way? It looks like it was designed to be
    >> able to use custom strongly typed complex objects, I just don't know
    >> how
    >> to populate the object.
    >> 2) How does one DEBUG a custom profile provider extension? I build
    >> both the parent web project in debug mode, as well as the custom
    >> provider as well. When I set a breakpoint and hit start, it'll always
    >> say either "No symbols loaded for this document" or "There is no
    >> executable code at this line numbers"
    >>
    >> I want it to break in Initialize() method, when should I expect it to
    >> break (application start is what I would have guessed)
    >>
    >> Please any input would be greatly appreciated.
    >> Weston

    >
    >
     
    Weston Weems, Feb 22, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Z2V0ZG90bmV0?=

    Custom profile provider asp.net 2.0

    =?Utf-8?B?Z2V0ZG90bmV0?=, Jul 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    567
    =?Utf-8?B?Z2V0ZG90bmV0?=
    Jul 6, 2005
  2. Guest
    Replies:
    2
    Views:
    1,778
    Steven Cheng[MSFT]
    Nov 14, 2005
  3. Replies:
    5
    Views:
    2,428
    abuShousheh
    Sep 12, 2008
  4. =?Utf-8?B?UGhpbA==?=

    Custom Profile Provider giving error on LastUpdatedDate

    =?Utf-8?B?UGhpbA==?=, Feb 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    462
    =?Utf-8?B?UGhpbA==?=
    Feb 13, 2006
  5. =?Utf-8?B?UmljaCBBcm1zdHJvbmc=?=

    Custom Profile provider is null

    =?Utf-8?B?UmljaCBBcm1zdHJvbmc=?=, Mar 30, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    452
    Steven Cheng[MSFT]
    May 4, 2006
Loading...

Share This Page