001/* 
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Florent Guillaume
011 */
012package org.nuxeo.ecm.core.opencmis.bindings;
013
014import javax.security.auth.login.LoginContext;
015import javax.security.auth.login.LoginException;
016
017/**
018 * Interface defining a login method, used during SOAP authentication.
019 * <p>
020 * The provider can be redefined by a Nuxeo Framework property named with the full name of this interface.
021 */
022public interface LoginProvider {
023
024    /**
025     * Log in the user given the username and password, and returns a login context.
026     *
027     * @param username the username
028     * @param password the password
029     * @return the login context
030     * @throws LoginException if the user cannot be logged in
031     */
032    LoginContext login(String username, String password) throws LoginException;
033
034}