0

I'm new to IIS Deployment. It looks like the application pool identity user will always show as computer name of the user. So if we use domain/username as app pool identity, it will always treat domain/username regardless who is logged in on the app.

How do you return the computer name of the user when authentication is both set to anonymous and windows authentication?

Here's what I have on Startup.cs

public void Configuration(IAppBuilder app)
    {
        app.UseCors(CorsOptions.AllowAll);
        //app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);

        OAuthAuthorizationServerOptions option = new OAuthAuthorizationServerOptions
        {
            TokenEndpointPath = new PathString("/token"),
            Provider = new ApplicationOAuthProvider(),
            AccessTokenExpireTimeSpan = TimeSpan.FromMinutes(300),
            AllowInsecureHttp = true
        };
        app.UseOAuthAuthorizationServer(option);
        app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());

    }

public void ConfigureServices(IServiceCollection services)
    {
        services.AddAuthentication(IISDefaults.AuthenticationScheme);
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

public void Configure(IApplicationBuilder app)
    {
        app.UseAuthentication();
    }

1 Answers1

0

How do you return the computer name of the user when authentication is both set to anonymous and windows authentication?

As far as I know,if you have already enabled the anonymous authentication, that means all the user will not use windows auth, it will use your IIS anonymous user as the user account.

The user account could be the specific user or the identity pool user based on your setting.

enter image description here

If you diable the anonymous authentication, it will use the client user's domain username which could set by client uswer to access your web application.

Brando Zhang
  • 22,586
  • 6
  • 37
  • 65