最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Integrating custom authentication module in opengrok - Stack Overflow

programmeradmin0浏览0评论

Problem : Since I am new to java and integrating multiple java projects, How can I Integrate my custom authentication java project module into opengrok source code.

Why ? To restrict the users who are allowed to access the opengrok instance.

My Custom Login and Authentication Module

I have a webpage for login. The authentication and authorization are done through LDAP and my backend PostgreSQL database. Once the user is verified, the jsessionid cookie is set through setAttribute. Whenever a webpage is accessed by a user, I have a filter (CheckAuth) which checks for this set attribute. If available, it allows the user to proceed to the page; otherwise, it redirects to the login page. Currently, the CheckAuth filter is applied on the path /secure/, but it can be changed to /.

Structure of Custom Login and Authentication Module:

├── pom.xml
└── src
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── my-app
    │   │           ├── CheckAuth.java  // checks for attr
    │   │           ├── DatabaseAccess.java //checks for LDAP authentication
    │   │           └── LDAPAuthenticator.java //checks for project authorization
    │   └── webapp
    │       ├── WEB-INF
    │       │   └── web.xml
    │       ├── authenticate.jsp
    │       ├── css
    │       │   └── styles.css
    │       ├── js
    │       │   └── scripts.js
    │       ├── login.jsp
    │       └── secure
    │           └── home.jsp
    └── test
        └── java
            └── com

How I Want This Custom Authentication Module to Be Applied on OpenGrok:

By default, the OpenGrok instance should be restricted for all users trying to access it, redirecting them to the login page every time. Once the user logs in and is authenticated, they should be allowed to visit the OpenGrok pages; otherwise, they should be redirected to the login page.

发布评论

评论列表(0)

  1. 暂无评论