Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3357356
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:37:22+00:00 2026-05-18T02:37:22+00:00

We have a custom javax.security.auth.spi.LoginModule used for web services as well as some web

  • 0

We have a custom javax.security.auth.spi.LoginModule used for web services as well as some web applications on a Weblogic 11g.

The goal is to record information regarding logins when going through the LoginModule, especially failed logins. Part of the desired information is the IP address that the authentication request came from. The problem I’m finding is I’m not sure how to get this information into the LoginModule.

Currently the LoginModule just verifies that the specified username and password match the values stored in a JDBC database. If the authentication fails it increments a counter to track the number of failed logins for that user, if they exist as a valid user. The username and password are passed in, if I understand it correctly, via the CallbackHandler that is specified during the initialize method. I’m not clear how these values get into the CallbackHandler at first and how to specify other dynamic content such as the request’s originating IP address. Through debugging I’ve found that the CallbackHandler does indeed have the request in the following chain: handler.ch.delegate.contextHandler.requestElement but I do not see how to get access to any of that from the CallbackHandler interface.

I researched some on AuditProviders and the like, finding one example that logged the HTTP method, so I would imagine that getting additional information from the HTTP Request would be possible, I’ve just not yet discovered it. However I will have to modify our custom Security Provider to create the AuditEvents to be audited. Part of that would be providing the Request, which gets us back to the initial problem of accessing the HttpServletRequest from within a LoginModule.

I tried implementing a ServletAuthenticationFilter as part of our Security Provider, but it seems that is call BEFORE authentication, which does not help us in capturing failed login attempts.

I’m relatively new to developing/modifying the security providers so basic examples/explanations are best.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:37:23+00:00Added an answer on May 18, 2026 at 2:37 am

    We capture the callback handler during LoginModule.initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) and store it as an attribute so that during the LoginModule.login() call we can pass in our callbacks and have the provided handler process it, getting us the data we want.

    We used a weblogic.security.auth.callback.ContextHandlerCallback and have the javax.security.auth.callback.CallbackHandler, specified during initialize, process this callback object via the javax.security.auth.callback.CallbackHandler.handle(Callback[]) method. Then you can gain access to the request with the following code:

    ContextHandler handler = contextHandlerCallback.getContextHandler();
    HttpServletRequest request = (HttpServletRequest)handler.getValue("com.bea.contextelement.servlet.HttpServletRequest");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom coded several enterprise applications for mid to large organizations to use
I have custom errors configured in my web.config, but IIS 6.0 is returning the
Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have a java class which fires custom java events. The structure of the
I have a few models that need to have custom find conditions placed on
hi i would like to create a custom calendar, this calendar will have custom
I have a custom validation function in JavaScript in a user control on a
I have a custom built ajax [div] based dynamic dropdown. I have an [input]
I have a custom installer action that updates the PATH environment, and creates an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.