Click here to Skip to main content
15,886,362 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Extending login webcontrol Pin
Not Active28-Mar-08 7:07
mentorNot Active28-Mar-08 7:07 
GeneralRe: Extending login webcontrol Pin
Rey999930-Mar-08 0:32
Rey999930-Mar-08 0:32 
GeneralRe: Extending login webcontrol Pin
Rey999930-Mar-08 21:20
Rey999930-Mar-08 21:20 
Generalsimple project Pin
laziale28-Mar-08 5:27
laziale28-Mar-08 5:27 
GeneralRe: simple project Pin
eyeseetee28-Mar-08 5:41
eyeseetee28-Mar-08 5:41 
GeneralRe: simple project Pin
J4amieC28-Mar-08 6:30
J4amieC28-Mar-08 6:30 
GeneralWebResource.axd gives SSL error warning - how do I turn it off? [modified] Pin
ERG Web Dev28-Mar-08 5:20
ERG Web Dev28-Mar-08 5:20 
QuestionMedium Trust webserver won't let me use a Forms Authentication Provider [modified] Pin
bambi_nl28-Mar-08 5:15
bambi_nl28-Mar-08 5:15 
Hi,

I have a website developed using Forms Authentication with the SqlMembershipProvider.
The host has set Medium Trust Level, which results in reflection being disabled.
When I access the page that has the login control, I get the following security exception:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I have dug into some information about forms authentication in ASP.NET 2.0, and as far as I can find out, forms authentication uses reflection to determine the provider to use.

The website is currently running on a webserver that does allow reflection, but I have to move to another provider because of several issues. Almost every hosting provider uses the medium trust level on their shared services. We do not want a dedicated server (too expensive and not necessary).

This is a snippet from the web.config where I set the membership provider and the profile.
<membership defaultProvider="ArtistSqlMembershipProvider" userIsOnlineTimeWindow="30"><br />
  <providers><br />
    <remove name="AspNetSqlMembershipProvider"/><br />
    <add name="ArtistSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="3" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="30" passwordStrengthRegularExpression=""/><br />
  </providers><br />
</membership><br />
<profile defaultProvider="AspNetSqlProfileProvider"><br />
  <properties><br />
    <group name="Personal"><br />
      <add name="FullName" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
      <add name="AddressLine1" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
      <add name="AddressLine2" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
      <add name="AddressLine3" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
      <add name="Country" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
      <add name="PhoneNumber" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
    </group><br />
    <group name="Privacy"><br />
      <add name="ShowEmail" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
      <add name="ShowAddress" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
      <add name="ShowPhoneNumber" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
    </group><br />
    <group name="Authorization"><br />
      <add name="AdminRights" type="System.Collections.Specialized.StringCollection" serializeAs="Binary" allowAnonymous="false"/><br />
    </group><br />
    <group name="Activity"><br />
      <add name="AdminCurrentVisit" type="System.DateTime" serializeAs="String" allowAnonymous="false"/><br />
      <add name="AdminPreviousVisit" type="System.DateTime" serializeAs="String" allowAnonymous="false"/><br />
      <add name="PublicCurrentVisit" type="System.DateTime" serializeAs="String" allowAnonymous="false"/><br />
      <add name="PublicPreviousVisit" type="System.DateTime" serializeAs="String" allowAnonymous="false"/><br />
      <add name="IPAddresses" type="System.Collections.Specialized.StringCollection" serializeAs="Binary" allowAnonymous="false"/><br />
    </group><br />
    <group name="Notification"><br />
      <add name="TradesSalesDigest" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
      <add name="ForumDigest" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
    </group><br />
  </properties><br />
</profile><br />


How can I resolve this?? Should I use another way of providing the forms authentication (and thus write the entire handling of the users myself)?? Can I come around the reflection another way??

modified on Sunday, March 30, 2008 5:33 AM

GeneralASP.Net, Multithreading, and Response object Pin
Vodstok28-Mar-08 5:15
Vodstok28-Mar-08 5:15 
GeneralRe: ASP.Net, Multithreading, and Response object [modified] Pin
nelo_28-Mar-08 5:51
nelo_28-Mar-08 5:51 
GeneralCall webservice method with messgedigest Pin
mpavas28-Mar-08 5:05
mpavas28-Mar-08 5:05 
Generalasp.net is not redirecting a page to proper login.aspx page for authentication. Pin
coolsatty28-Mar-08 5:01
coolsatty28-Mar-08 5:01 
GeneralRe: asp.net is not redirecting a page to proper login.aspx page for authentication. Pin
eyeseetee28-Mar-08 5:09
eyeseetee28-Mar-08 5:09 
GeneralRe: asp.net is not redirecting a page to proper login.aspx page for authentication. Pin
coolsatty29-Mar-08 5:15
coolsatty29-Mar-08 5:15 
GeneralRe: asp.net is not redirecting a page to proper login.aspx page for authentication. Pin
Jesse Squire28-Mar-08 5:11
Jesse Squire28-Mar-08 5:11 
GeneralRe: asp.net is not redirecting a page to proper login.aspx page for authentication. Pin
farazsk1129-Mar-08 2:31
farazsk1129-Mar-08 2:31 
GeneralRe: asp.net is not redirecting a page to proper login.aspx page for authentication. Pin
coolsatty29-Mar-08 4:50
coolsatty29-Mar-08 4:50 
GeneralRe: asp.net is not redirecting a page to proper login.aspx page for authentication. Pin
farazsk1129-Mar-08 7:34
farazsk1129-Mar-08 7:34 
GeneralFileUpload Problem Pin
zeeShan anSari28-Mar-08 4:51
zeeShan anSari28-Mar-08 4:51 
GeneralRe: FileUpload Problem Pin
eyeseetee28-Mar-08 4:52
eyeseetee28-Mar-08 4:52 
GeneralRe: FileUpload Problem Pin
Jesse Squire28-Mar-08 5:00
Jesse Squire28-Mar-08 5:00 
GeneralRe: FileUpload Problem Pin
zeeShan anSari28-Mar-08 5:12
zeeShan anSari28-Mar-08 5:12 
GeneralRe: FileUpload Problem Pin
Jesse Squire28-Mar-08 5:18
Jesse Squire28-Mar-08 5:18 
AnswerRe: FileUpload Problem Pin
zeeShan anSari28-Mar-08 5:22
zeeShan anSari28-Mar-08 5:22 
QuestionHow can I add my own button to ASP .NET Wizard Pin
Alex Shapovalov28-Mar-08 4:12
professionalAlex Shapovalov28-Mar-08 4:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.