Giter Club home page Giter Club logo

Comments (4)

pysco68 avatar pysco68 commented on August 30, 2024

First of all: Could you post a bit more of your solution? Just by what you're saying I'm having a hard time to see where the issue is.

Some clues:

  • have you triggered authentication yet?
  • is the NTLM auth middleware at the right place in the OWIN pipeline (before any application level middleware that actually answers requests)?

from pysco68.owin.authentication.ntlm.

ffogell avatar ffogell commented on August 30, 2024

Hey , what do you mean by "have you triggered authentication yet?" do you mean that just with the default setup it does not ask for credentials ?

And I have to do that check everytime someone calls my api ? => if (this.User == null)
{
var ap = new AuthenticationProperties()
{
RedirectUri = redirectUrl
};

    var context = this.Request.GetContext();
    context.Authentication.Challenge(ap, NtlmAuthenticationDefaults.AuthenticationType);
    return Unauthorized();
}

Btw tyvm for the fast response !

from pysco68.owin.authentication.ntlm.

pysco68 avatar pysco68 commented on August 30, 2024

Well, as I said I don't know much about your setup.

It is common practice among OWIN Authentication middlewares to wait for a challenge before taking action. This means that if your controller / Nancy application does not require for authentication, then nothing will happen.

To be honest, I didn't try my middleware with Nancy. In ASP.NET MVC / WebAPI you define a per-controller/per-route authorization attribute or insert a small middleware that does so somewhere in the pipeline (usually before any business level controller are being handled).

Maybe this can help you a bit: https://github.com/NancyFx/Nancy/wiki/Authentication-overview

from pysco68.owin.authentication.ntlm.

pysco68 avatar pysco68 commented on August 30, 2024

Any update on this? If your problem's resolved, please close this issue. I will do so upon no answer in the next 30 days.

Best regards,
Yannic

from pysco68.owin.authentication.ntlm.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.