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 3949100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:27:12+00:00 2026-05-20T01:27:12+00:00

I am trying to implement session management in my REST service. I came to

  • 0

I am trying to implement session management in my REST service. I came to know these guidelines while surfing :

  1. Not using server side sessions – it violates the RESTful principle.

  2. Using HTTP Basic authentication – Not possible right now, as I am asked not to use SSL/TLS (which is no doubt needed for Basic auth.)

  3. Using Http digest – I heard this increases network traffic. This sounds costly, especially when my client is a mobile device.

  4. Using cookies – I am told I should never rely on cookie for securing my important resources, they can be spoofed easily. Plus, I read about cross-site scripting attacks through cookies.

  5. I am left with an option of generating authentication token ,which the user has to send everytime – which I admit is not “entirely” RESTful.

Now I need to know, how should I generate these unique authentication tokens, which are secure enough at a business level ? Is there some library for Jersey ? Should I go for OAuth..I have just read a little about them, are they useful in my case ? Please keep in mind that my target clients are mobile devices – can they access an OAuth service ??

  • 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-20T01:27:13+00:00Added an answer on May 20, 2026 at 1:27 am

    For simplicity sake, I generate my own authentication token using UUID before encrypting the entire token with Jasypt:-

    String key = UUID.randomUUID().toString().toUpperCase() +
            "|" + someImportantProjectToken +
            "|" + userName +
            "|" + creationDateTime;
    
    StandardPBEStringEncryptor jasypt = new StandardPBEStringEncryptor();
    
    ...
    
    // this is the authentication token user will send in order to use the web service
    String authenticationToken = jasypt.encrypt(key);
    

    The key contains the creationDateTime so that I can use it to verify the time-to-live. This way, if the user uses the same authentication token after X minutes, it will not work anymore, and I’ll send back a 403 forbidden code.

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

Sidebar

Related Questions

I'm trying to implement stateless session bean ejb3 in jboss5 using netbeans6.8 as a
Background I am trying to implement a RESTful web service using Apache-CXF that interacts
I am trying to implement a DTLS server using OpenSSL. I can get app
I'm trying to implement a stateful web service in PHP using the SOAP extension.
I am trying to implement some proper NHibernate session management in my console application,
I'm currently working on a ASP.Net 3.5 project and trying to implement session timeout
I am trying to implement a Session-Per-Conversation pattern in a JSF2-Spring-Hibernate Web App so
I am trying to implement a session-per-request pattern in an ASP.NET MVC 2 Preview
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every
Trying to implement 3-layer (not: tier, I just want to separate my project logically,

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.