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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:01:26+00:00 2026-05-23T12:01:26+00:00

My application has some features that are accessible to all users, and some other

  • 0

My application has some features that are accessible to all users, and some other features to which access should be restricted to authenticated users only. All these restricted features exists within some set of GWT Places, thus, all Places available in application can be divided into two groups: “accessible for all”, and “restricted”. In my opinion, places with restricted access, could implement some interface (let’s say it would be RestrictedAccess), and if user proceeds to one of them, and it has not been authenticated yet, it will be redirected to the login screen – it’s more OO-approach than applying filters basis on URL.

What I’m trying to achieve is:

  1. Information about if user has been
    authenticated or not should be
    stored on server (it’s not something
    that could be stored in a cookie…)
  2. Login page is a standard GWT place+view+activity (!)
  3. User name & password validation is done on the server side.

So far, I’ve introduced RestrictedAccess interface, which is implemented by some set of places. My FilteredActivityMapper.Filter implementation, which is passed to the FilteredActivityMapper wrapping application activity mapper has the following logic:

Place filter(Place place) {
    if (place instanceof RestrictedAccess && !userHasBeenAuthenticated()) {
      return new LoginPlace();
    }

    // return the original place - user has been already authenticated or
    // place is accesible for all users
    return place;
}


private boolean userHasBeenAuthenticated() {
    // remote call - how to do ???
}

The problem is with userHasBeenAuthenticated() method (user should not be redirected to the LoginPlace, if it has been already authenticated). If I want to store this information on the server-side, I have to do GWT RPC/request factory call here, but both are asynchronous, so I cannot work on its result in the filter method.

I know that I can use web.xml filters or some external framework (e.g. spring security), but none of this approach allows me to have login page as a standard GWT – based form, or indicating in the more OO way that access to some place should be restricted.

Thanks in advance for any hints

EDIT: I’ve started to wondering if places filtering (restricted/not restricted) should take place on the client side at all. If, as it was suggested, there is a possibility to hack code indicating if user has been authenticated or not, there is also possibility to hack places filtering code, so that it will be possible to access restricted places without signing in.

  • 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-23T12:01:27+00:00Added an answer on May 23, 2026 at 12:01 pm

    Piotrek,

    I think there is a security issue with calling userHasBeenAuthenticated() – it would be possible to hack the client side code to return true every time this function is called.

    The solution I’ve implemented is to simply return SC_UNAUTHORIZED if an unauthenticated user attempts to access any remote service. I’ve overridden the RequestFactory onResponseReceived function which redirects to a login page if the response is SC_UNAUTHORIZED. Idea taken from:
    http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/expenses/src/main/java/com/google/gwt/sample/gaerequest/client/GaeAuthRequestTransport.java

    This works for our situation where the Activities and Places are all data-centric – each place change retrieves data from the server. If a user isn’t authenticated they simply don’t get the data and get redirected to a login page.

    I realize your situation is slightly different in that some places are accessible to everyone, in which case you could configure only the restricted services to return SC_UNAUTHORIZED.

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

Sidebar

Related Questions

I'm working on an intranet-only web application (J2EE) that requires some basic security features.
I am planning to create an application in android which has following features Show
I wonder if I should use the CAS protocol or OAuth + some authentication
Background I, like scores of programmers before me, am working on an application that
First of all, I'll clarify some words: when I use the word user you
I implemented on Android a small application that sends through a socket connection strings
This will appear to be the age old question (which it is :)) that
I'm building an app that authors would (hopefully) use to help them, uh.. author
I'm working on a project that is currently using the Zend Framework 1.7.6, however
I'm working on a Rails application and it is currently hosted on a shared

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.