예제 #1
0
  public static void loadSessionFromStore(CredentialsStoreBuilder.StorageType storageType)
      throws IllegalStateException {

    CredentialsStore storage =
        new CredentialsStoreBuilder()
            .setContext(LiferayScreensContext.getContext())
            .setStorageType(storageType)
            .build();

    checkIfStorageTypeIsSupported(storageType, storage);

    if (storage.loadStoredCredentials()) {
      _session = new SessionImpl(LiferayServerContext.getServer(), storage.getAuthentication());
      _loggedUser = storage.getUser();
    }
  }