Example usage for org.apache.wicket.authentication IAuthenticationStrategy save

List of usage examples for org.apache.wicket.authentication IAuthenticationStrategy save

Introduction

In this page you can find the example usage for org.apache.wicket.authentication IAuthenticationStrategy save.

Prototype

void save(final String credential, final String... extraCredentials);

Source Link

Document

If "rememberMe" is enabled and login was successful, then store the given credentials in the persistence store (e.g.

Usage

From source file:org.yes.cart.shoppingcart.impl.WicketLoginCommandImpl.java

License:Apache License

/** {@inheritDoc} */
@Override/*from   ww  w.j a  v  a 2s.c o  m*/
public void execute(final MutableShoppingCart shoppingCart, final Map<String, Object> parameters) {
    super.execute(shoppingCart, parameters);
    if (parameters.containsKey(getCmdKey()) && shoppingCart.getLogonState() == ShoppingCart.LOGGED_IN) {

        final String email = (String) parameters.get(CMD_LOGIN_P_EMAIL);
        final String passw = (String) parameters.get(CMD_LOGIN_P_PASS);

        final IAuthenticationStrategy strategy = Application.get().getSecuritySettings()
                .getAuthenticationStrategy();
        strategy.save(email, passw);
    }
}