c# - N2 Customize Login Logic -
we have need customize logic of our n2 authentication add couple of options.
i need add radiobuttonlist contains options , set session var based on selection of radiobutton on login - otherwise user cannot see site in preview pane of n2. thought add radiobuttonlist n2/login.aspx , create custom login class extended n2.edit.login , override login1_authenticate method custom logic before calling base.login1_authenticate. seems not designed extensible , cannot override method. make change have custom compile of n2 these changes, want avoid (should closed modification open extension) don't have redo our changes every time update n2.
another route tried create n2/customlogin.aspx , add of logic in custom class , set web.config point customlogin.aspx instead of login.aspx - sent me correct login page failed login redirected me login.aspx (assuming hard coded) did not have our radio button options.
we using n2 cms 2.0.0.0 on .net 4.0 (mvc app)
n2 uses standard forms auth, asp.net membership , roles providers under covers. long logged on user either named admin or in 1 of 3 n2 standard roles (administrators, editor , authors - think), able access admin site.
so recommend create separate login page in app. point forms auth @ custom login page using entry in web.config:
<authentication mode="forms"> <forms loginurl="~/account/login" timeout="2880" /> </authentication>
in custom login form can standard forms auth stuff user signed in, setting session variable.
i've done few times , works fine. if can't working suggest provide sample demonstrates problem , i'll see if can help.
Comments
Post a Comment