简体   繁体   中英

Is IIS Form Authentication related anonymous authentication account?

Some resources (images) don't appear when I visit the main page after login (using form authentication) However, setting the attribute of anonymous authentication to 'application pool id' in iis manager works

what windows account is used for form authentication in iis?

Only the login Page need anonymous authorization access. It sounds like you didn't set anonymous authentication correctly.

When we implement form authentication in IIS, Both form authentication and anonymous authentication are enabled side-by-side. Then we will create allow auth rule for all user and deny anonymous user in site level.

<authentication mode="Forms">
  <forms name=".MyCookie" loginUrl="Login" protection="All" timeout="60" />
</authentication>
<authorization>
  <deny users="?" />
  <allow users="*" />
</authorization>

Secondly, we need to create a authorization rule to allow anonymous access to login page.

 <location path="Login">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

When you pass the form authentication, IIS will send a form authentication cookie with the username which is decided by your application. It can be a key in appsetting or a username from database.

1.

FormsAuthentication.SetAuthCookie(UserInfo.UserName, false, FormsAuthentication.FormsCookiePath);

2.

FormsAuthenticationTicket

3.

FormsAuthentication.RedirectFromLoginPage(UserInfo.UserName, false);

You need to make sure the auth_user and application pool identity have permission to access the image sources. https://support.microsoft.com/en-us/help/301240/how-to-implement-forms-based-authentication-in-your-asp-net-applicatio

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM