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

  • SEARCH
  • Home
  • 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 4620334
In Process

The Archive Base Latest Questions

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

I have an interesting project requirement where we must accept a token as a

  • 0

I have an interesting project requirement where we must accept a token as a GET paramenter that will authenticate a user coming into an application. This is to allow trusted third parties to seamlessly send a user over to our site without having to make them log in again.

An example might be:
http://www.myproj.com/appName/index.jsf?user_token=asdf123randomstuffaf12fsaasdf

appName would be the context root, and user_token would be a token that could be checked. The token will be used once, then thrown away, and they expire a few seconds after generation. The token part is not really what i’m hung up on, it’s the integration with JAAS.

In Spring Security, I can setup a filter that would intercept the request, pull the token out of the URL, and authenticate the user against a UserDetailsService. Sadly, Spring Security is not available on this project for a myriad of issues, so we are going to need to use JAAS authentication.

I’m not asking for code, but I could use a little basic direction on what modules would need to be written so I can continue my research. Thanks everyone,

  • 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-22T02:32:48+00:00Added an answer on May 22, 2026 at 2:32 am

    JAAS isn’t really suitable for web application. It is more for desktop applications which support interactive inputs and accessing local resources managed by the JVM such as files, network sockets.

    But if you really want to go down the JAAS road, prepare to write your custom LoginModule and probably a CallbackHandler and Principal. Most important class is the LoginModule. You might be able to reuse some existing Principal class.

    The CallbackHandler would pull the token out of the URL. The LoginModule would look that token up against some database, and populate the passed-in Subject with some Principal.

    It may sound confusing because the terms are quite close (Subject vs Principal, LoginModule vs CallbackHandler) so the docs should be at a close distance.

    After you’ve done all of this, you will also need to configure the web container’s policy to load a new login context (yet another very related term). This is like configuring PAM in Linux. Ask your administrator to do this for you.

    But you haven’t finished yet. The last task is to write a (I assume you are developing something based on Java Servlet) filter. This filter should be hooked at the very first level. If it sees a special parameter value (such as user_token), it obtains the configured LoginContext object, and calls its login method.

    Now, if you scrap JAAS altogether, you could make do with just the servlet filter. In this filter, if authentication is successful, you could populate the session object with your own custom objects (such as a User object) to signify a success. Much more simple.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Interesting one here. I have an ASP.NET 1.1 project that contains a web service
Hey all, I have something of an interesting requirement for my project. I need
I have some interesting problem for an hour.. In my flex project, all width
I have an interesting SQL problem that I need help with. Here is the
I have an interesting problem. The basis of the problem is that my last
I have an interesting genetics problem that I would like to solve in native
I have an interesting problem, which is a function that returns a Dictionary<String,HashSet<String>> .
I have a interesting question: I want to split the year into 4 quarters.
I have a rather interesting question that seems simple to answer, yet I have
I have a pretty interesting dilemma that is giving me a hurricane of a

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.