Code Monkey home page Code Monkey logo

Comments (3)

adamcrown avatar adamcrown commented on July 26, 2024

I'm not sure what your application looks like, but it's important to remember that rack-cas will never automatically authenticate users. It requires a 401 (unauthenticated) status to be returned by the app. So generally you can only return a 401 in the parts of your app that you want to be authenticated. This pattern gives you a lot of flexibility and it's rare to have to deal with exclude_path.

exclude_path is really only meant to be used for APIs. APIs aren't going to use CAS authentication, so you want those 401 responses to be preserved rather than being redirected to a CAS login page.

Let me know your exact situation if that isn't going to work for you and we'll see if we can work something out.

from rack-cas.

morandat avatar morandat commented on July 26, 2024

I’ll have only some part of my app that need to be authenticated. For those I can do whatever I want with 401, the other should not play with it. Since there are no such regexp that match absence of patterns, the exclude can’t do the trick. Except splitting my app, I don’t see any alternatives (and it’s a shame to split the app for one route only). Maybe I'll just step back to plain ldap authentication at nginx level ... at least I'll work, without needing a brain ;)

from rack-cas.

adamcrown avatar adamcrown commented on July 26, 2024

Well, I'd imagine a negative lookahead regular expression would do the trick. Something like:

exclude_path: /^(?!/your/authentication/required/path)/

from rack-cas.

Related Issues (20)

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.