Git Product home page Git Product logo

Comments (9)

AnthonyDeroche avatar AnthonyDeroche commented on June 1, 2024

Hey,

Yes it is possible.
Whatever the module you use for authentication (files, databases, ...), it does not require to restart Apache if you add users.
All you have to do then is to get the folder (PATH_INFO) from the requested URL and compare it with the current authenticated user (REMOTE_USER).

from mod_authnz_jwt.

apishta avatar apishta commented on June 1, 2024

Hi Anthony,

Thnx for your quick answer.
I don't have access to REMOTE_USER, actually, it is empty, because I don't use jwt-login-handler. I am using the JWT created by the external application.
Would be possible to make the following:
parse a folder name from PATH_INFO and compare it with the username from JWT
Require jwt-claim user=folder_name
?

Thank you very much.

from mod_authnz_jwt.

AnthonyDeroche avatar AnthonyDeroche commented on June 1, 2024

The REMOTE_USER is set whatever you use the jwt-login-handler or not. After the signature check, the REMOTE_USER is extracted from the token claims (using AuthJWTAttributeUsername).

from mod_authnz_jwt.

AnthonyDeroche avatar AnthonyDeroche commented on June 1, 2024

Did you finally succeed ?

from mod_authnz_jwt.

apishta avatar apishta commented on June 1, 2024

I did not have time to work on this yet. Probably I will do it in the next weeks.
Thanks for asking.

from mod_authnz_jwt.

germainm avatar germainm commented on June 1, 2024

The REMOTE_USER is set whatever you use the jwt-login-handler or not. After the signature check, the REMOTE_USER is extracted from the token claims (using AuthJWTAttributeUsername).

How can the client get REMOTE_USER ? I don't see that value returned. Only the json token is returned and some headers like Content-Type and Content-Length.

It probably has to do with apache Header module but I could not getting it to work .

from mod_authnz_jwt.

AnthonyDeroche avatar AnthonyDeroche commented on June 1, 2024

The REMOTE_USER is usually not intended to the client but the to the backend application. The app may decode it and expose a service to get data.
If you need so, you can probably set a header in the response with the REMOTE_USER.

The following code allow you to add the header in the request.
For the response, you could try the same way with the "Header" directive.

RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule . - [E=RU:%1]
RequestHeader set X-Remote-User "%{RU}e" env=RU

from mod_authnz_jwt.

AnthonyDeroche avatar AnthonyDeroche commented on June 1, 2024

Did everyone succeed to get the REMOTE_USER ?

from mod_authnz_jwt.

apishta avatar apishta commented on June 1, 2024

I have decided to extend WebdavServlet on tomcat. That solution was a more suitable solution for my project.

from mod_authnz_jwt.

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.