/*
 * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2014, Gluu
 */

package org.xdi.model.custom.script.type.auth;

import java.util.List;
import java.util.Map;

import org.xdi.model.AuthenticationScriptUsageType;
import org.xdi.model.SimpleCustomProperty;
import org.xdi.model.custom.script.type.BaseExternalType;

/**
 * Base interface for external authentication python script
 *
 * @author Yuriy Movchan Date: 08/21/2012
 */
public interface PersonAuthenticationType extends BaseExternalType {

	public boolean isValidAuthenticationMethod(AuthenticationScriptUsageType usageType, Map<String, SimpleCustomProperty> configurationAttributes);

	public String getAlternativeAuthenticationMethod(AuthenticationScriptUsageType usageType, Map<String, SimpleCustomProperty> configurationAttributes);

	public boolean authenticate(Map<String, SimpleCustomProperty> configurationAttributes, Map<String, String[]> requestParameters, int step);

	public boolean prepareForStep(Map<String, SimpleCustomProperty> configurationAttributes, Map<String, String[]> requestParameters, int step);
	
	public int getCountAuthenticationSteps(Map<String, SimpleCustomProperty> configurationAttributes);

	public String getPageForStep(Map<String, SimpleCustomProperty> configurationAttributes, int step);

	public List<String> getExtraParametersForStep(Map<String, SimpleCustomProperty> configurationAttributes, int step);

	public boolean logout(Map<String, SimpleCustomProperty> configurationAttributes, Map<String, String[]> requestParameters);

}

@@ -1,10 +1,11 @@
 /*
+%0D
 %0A * oxCo
@@ -103,19 +103,21 @@
 ll text.
+%0D
 %0A *
+%0D
 %0A * Copy
@@ -136,21 +136,24 @@
 14, Gluu
+%0D
 %0A */
-%0A
+%0D%0A%0D
 %0Apackage
@@ -191,17 +191,19 @@
 pe.auth;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -217,16 +217,17 @@
 il.List;
+%0D
 %0Aimport 
@@ -240,17 +240,19 @@
 til.Map;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -295,16 +295,17 @@
 ageType;
+%0D
 %0Aimport 
@@ -339,16 +339,17 @@
 roperty;
+%0D
 %0Aimport 
@@ -402,13 +402,16 @@
 ype;
-%0A
+%0D%0A%0D
 %0A/**
+%0D
 %0A * 
@@ -466,19 +466,21 @@
 n script
+%0D
 %0A *
+%0D
 %0A * @aut
@@ -513,20 +513,22 @@
 /21/2012
+%0D
 %0A */
+%0D
 %0Apublic 
@@ -588,17 +588,19 @@
 alType %7B
-%0A
+%0D%0A%0D
 %0A%09public
@@ -728,33 +728,35 @@
 tionAttributes);
-%0A
+%0D%0A%0D
 %0A%09public String 
@@ -882,33 +882,35 @@
 tionAttributes);
-%0A
+%0D%0A%0D
 %0A%09public boolean
@@ -1025,33 +1025,173 @@
 ters, int step);
-%0A
+%0D%0A%0D%0A%09public int getNextStep(Map%3CString, SimpleCustomProperty%3E configurationAttributes, Map%3CString, String%5B%5D%3E requestParameters, int step);%0D%0A%0D
 %0A%09public boolean
@@ -1316,18 +1316,20 @@
 t step);
+%0D
 %0A%09
+%0D
 %0A%09public
@@ -1420,17 +1420,19 @@
 ibutes);
-%0A
+%0D%0A%0D
 %0A%09public
@@ -1515,33 +1515,35 @@
 utes, int step);
-%0A
+%0D%0A%0D
 %0A%09public List%3CSt
@@ -1643,17 +1643,19 @@
 t step);
-%0A
+%0D%0A%0D
 %0A%09public
@@ -1774,8 +1774,11 @@
 rs);
-%0A
+%0D%0A%0D
 %0A%7D
+%0D
 %0A

Allow to return to previous authentication step