Extendig SqlMembershipprovider

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Extendig SqlMembershipprovider

    Hi,

    SqlMembershipProvider does (allmost) what I want.
    So I'm not willing to write my own provider.

    But I want to change some little things.
    a.) I want to be able to add an "Email-OptIn feature"
    so the user should get an email with a link "Click here to activate your account"
    b.) I want enhance the above thing to a "Managed OptIn Feature"
    so the email goes first to an admin
    he either chooses to negotiate or to accept the user by redirecting the mail to him

    Until the user didn't click on that "verification link" the account should not be able to login.

    Can this be done without writing my own provider, and using the existing controls?

    Cheers

    Manfred


    ManniAT Guest

  2. #2

    Default Re: Extendig SqlMembershipprovider

    > a.) I want to be able to add an "Email-OptIn feature" 

    So you can set the DisableCreatedUser=true for your CreateUserWizard control.
    This way when the user account si crated, it's initially diasbled. Also handle
    the CreatedUser event to send an email with the link or URL they must click
    to activate the account.
     

    Again, this is just logic in your Createduser event that decided who to send
    the email to and updates your workflow as appropriate.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen




    Brock Guest

  3. #3

    Default Re: Extendig SqlMembershipprovider

    Hi Brock,

    thank you for your reply. I solved it 2 days ago in the way you suggested.
    Maybe anybody else will also have such a "problem" so I will tell a short how to.
    After digging in the things I found that it is pretty easy to to such a thing.

    I tell the wizard not to activate the user (as you wrote).
    I handle the "CreatedUser" event. There I made a GUID and use a part of if as
    some kind of "activaton string". I store this in User.Comment.
    And I send a mail to the user.with a link to the activation page.
    Furtheron I solved another thing here - a "default role membership".

    Than I made a page ("ActivateUser") where I load the user, check if
    the passsed "ID" fits the comment - and if so I set User.IsApproved to true.

    The only tricky thing (I found no other way than this) is to have an email after
    resetting the password. Since the PWD is not readable I could only parse it somehow
    from the e.Message.body in the "SendingMail" event. This seems a little unsave,
    since the format of the message can change.
    So I do another ResetPWD to get the new for my mail message.
    With that approach I have also the ability to enforce another "activation" step again.

    The things were pretty easy - after finding out where to intercept the system :-)

    Cheers

    Manfred


    ManniAT Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139