If you can funnel your remote calls through a single remote implementation 
(.ie you can have your async interfaces extend from a common abstract 
class), you can throw an authentication exception when the user's 
credentials have expired, catch it client side and toss up a login dialog 
over top of the current page to have them log in again and then resend the 
previous command that failed with the authentication error after they've 
signed back in.  This gives the user a seemless experience of re-logging in 
without losing their current place in the app.  

I feel that's the best user experience for handling timed out users unless, 
of course, you need a higher security option of clearing everything the 
user is doing once their credentials expire - like in banking apps, etc.

On Friday, April 22, 2016 at 8:53:59 AM UTC-5, salk31 wrote:
>
> I think it is worth deciding what you want to happen when the users 
> credentials timeout (or are lost) on the server side.
>
> Personally I hate it when Ajax/single page apps quietly fail when 
> authentication has expired.
>
> Cheers
>
> Sam
>
> On Monday, April 11, 2016 at 3:10:53 PM UTC+1, Olar Andrei wrote:
>>
>> Hello,
>>
>> I'm new to GWT and a I have a problem, which I don't understand quite 
>> well. I'm making a GWT application where a user is required to log in. So I 
>> do my stuff, by checking the username and password if they match and so on.
>> But, on the onSuccess() method, what needs to be done in order to open 
>> the actual application ? I mean the current application is just the login 
>> screen with the DB connection. What needs to be done if they match, how do 
>> I open a new page, or a new application... ?
>>
>> I understood that GWT basically is just a one-page application. Then how 
>> should I do this ? 
>>
>> Thanks in advance.
>>
>> DBConnectionAsync rpcService = (DBConnectionAsync) 
>> GWT.create(DBConnection.class);
>> ServiceDefTarget target = (ServiceDefTarget) rpcService;
>> String moduleRelativeURL = GWT.getModuleBaseURL() + "DBConnectionImpl";
>> target.setServiceEntryPoint(moduleRelativeURL);
>> rpcService.authenticateUser("admin", "admin", new AsyncCallback<User>() {
>>    @Override
>>    public void onSuccess(User result) {
>>      // What to do here ?
>>    }
>>    @Override
>>    public void onFailure(Throwable caught) {
>>       // Failure
>>    }
>> });
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to