MohammadYounes / OWIN-MixedAuth

Mixed (Windows + Forms) Authentication for OWIN
MIT License
109 stars 46 forks source link

Determining if user is internal/external #66

Closed arc95 closed 7 years ago

arc95 commented 7 years ago

Hi @MohammadYounes. Working on implementing the auto login for Windows users. Would I need to also add this code to make it work? change to RegisterMixedAuth()

I'm getting a Server Error in '/' Application. Object reference not set to an instance of an object. when I launch the MVC5-MixedAuth with the changes indicated here.

[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.Owin.Security.Cookies.<AuthenticateCoreAsync>d__0.MoveNext() +324
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.Owin.Security.Infrastructure.<BaseInitializeAsync>d__2.MoveNext() +616
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +255
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +69
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +64
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +380
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Thanks.

MohammadYounes commented 7 years ago

Hi,

No, that check will be based on IP address to decide whether to send the challenge or not.

The steps mentioned in the comment are to enable Auto Windows Login, try clearing your cookies and run the application again.

Thanks.

arc95 commented 7 years ago

Thanks, @MohammadYounes. Should I be doing these changes in the MVC5-MixedAuth or OWIN-MixedAuth solutions?

MohammadYounes commented 7 years ago

These are for OWIN-MixedAuth.