/*
 * @(#)TestAuthenticationAuthority.java
 *
 * Copyright (C) 2007 Infocity Inc. All Rights Reserved.
 */
package test.info.dragonlady.sso.authority;

import info.dragonlady.sso.authority.AuthenticationAuthority;
import info.dragonlady.sso.authority.AuthorityException;

/**
 * 認証オーソリティのテスト用実装クラス。
 * 
 * @author Hiroshi.Ebata(INFOCITY)
 * @version $Revision: 1.0 $ $Date: 2007/06/05 19:41:28 $
 */
public class TestAuthenticationAuthority extends AuthenticationAuthority {

	private boolean success = true;

	public TestAuthenticationAuthority() {
	}

	public void setResult(boolean success) {
		this.success = success;
	}

	/* (non-Javadoc)
	 * @see info.dragonlady.sso.authority.AuthenticationAuthority#authenticate(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
	 */
	@Override
	protected boolean authenticate(String authId, String confirmationMethod,
			String confirmationData, String authMethod) throws AuthorityException {
		return success ? authId.startsWith("authId") : success;
	}

}
