@Override public void authenticate() { if (session.isConnected()) { UserProfile userProfile = session.getUserProfile(); credentials.setCredential(session.getAccessToken()); setStatus(AuthenticationStatus.SUCCESS); setAccount(new AgoravaUser(userProfile)); } else { String authorizationUrl = lifeCycleService.startDanceFor(settings.getQualifier()); try { response.get().sendRedirect(authorizationUrl); } catch (IOException e) { throw new AgoravaException("Unable to redirect user to: " + authorizationUrl); } credentials.setStatus(Status.IN_PROGRESS); setStatus(AuthenticationStatus.DEFERRED); } } }