Browse Source

v1.4.0RC1

shimingxy 5 years ago
parent
commit
08be0df891
37 changed files with 737 additions and 737 deletions
  1. 0 8
      .settings/org.eclipse.buildship.core.prefs
  2. 1 0
      maxkey-client-sdk/.classpath
  3. 1 0
      maxkey-core/.classpath
  4. 113 0
      maxkey-core/.settings/org.eclipse.jdt.core.prefs
  5. 213 219
      maxkey-core/src/main/java/org/maxkey/crypto/ReciprocalUtils.java
  6. 290 396
      maxkey-core/src/main/java/org/maxkey/domain/apps/AppsSAML20Details.java
  7. 2 0
      maxkey-dao/.classpath
  8. 1 0
      maxkey-protocols/maxkey-protocol-cas/.classpath
  9. 11 0
      maxkey-protocols/maxkey-protocol-oauth-2.0/.settings/org.eclipse.jdt.core.prefs
  10. 1 1
      maxkey-web-manage/.project
  11. 11 0
      maxkey-web-manage/.settings/org.eclipse.jdt.core.prefs
  12. 5 5
      maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsAdd.ftl
  13. 4 6
      maxkey-web-manage/src/main/resources/templates/views/apps/appAddCommon.ftl
  14. 4 6
      maxkey-web-manage/src/main/resources/templates/views/apps/appUpdateCommon.ftl
  15. 3 3
      maxkey-web-manage/src/main/resources/templates/views/apps/appsExtendAttr.ftl
  16. 2 4
      maxkey-web-manage/src/main/resources/templates/views/apps/cas/appAdd.ftl
  17. 2 2
      maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl
  18. 3 3
      maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl
  19. 3 3
      maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl
  20. 4 6
      maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl
  21. 2 2
      maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appUpdate.ftl
  22. 3 3
      maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appAdd.ftl
  23. 4 4
      maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appUpdate.ftl
  24. 4 5
      maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl
  25. 10 18
      maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl
  26. 12 14
      maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl
  27. 3 5
      maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl
  28. 2 2
      maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl
  29. 1 1
      maxkey-web-manage/src/main/resources/templates/views/groups/groupAdd.ftl
  30. 1 1
      maxkey-web-manage/src/main/resources/templates/views/groups/groupUpdate.ftl
  31. 1 0
      maxkey-web-maxkey/.classpath
  32. 10 10
      maxkey-web-maxkey/.project
  33. 2 2
      maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl
  34. 2 2
      maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl
  35. 1 1
      maxkey-web-maxkey/src/main/resources/templates/views/profile/myProfile.ftl
  36. 3 3
      maxkey-web-maxkey/src/main/resources/templates/views/safe/changePassword.ftl
  37. 2 2
      maxkey-web-maxkey/src/main/resources/templates/views/safe/setting.ftl

+ 0 - 8
.settings/org.eclipse.buildship.core.prefs

@@ -1,10 +1,2 @@
-build.commands=org.eclipse.jdt.core.javabuilder
-connection.arguments=
-connection.java.home=null
-connection.jvm.arguments=
 connection.project.dir=
-containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7/
-derived.resources=.gradle,build
 eclipse.preferences.version=1
-natures=org.eclipse.jdt.core.javanature
-project.path=\:

+ 1 - 0
maxkey-client-sdk/.classpath

@@ -10,6 +10,7 @@
 		<attributes>
 			<attribute name="gradle_scope" value="test"/>
 			<attribute name="gradle_used_by_scope" value="test"/>
+			<attribute name="test" value="true"/>
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>

+ 1 - 0
maxkey-core/.classpath

@@ -10,6 +10,7 @@
 		<attributes>
 			<attribute name="gradle_scope" value="test"/>
 			<attribute name="gradle_used_by_scope" value="test"/>
+			<attribute name="test" value="true"/>
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="src" output="bin/main" path="src/main/resources">

+ 113 - 0
maxkey-core/.settings/org.eclipse.jdt.core.prefs

@@ -8,9 +8,122 @@ org.eclipse.jdt.core.circularClasspath=warning
 org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
 org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
 org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
 org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.release=disabled
 org.eclipse.jdt.core.compiler.source=1.8
 org.eclipse.jdt.core.incompatibleJDKLevel=ignore
 org.eclipse.jdt.core.incompleteClasspath=error

+ 213 - 219
maxkey-core/src/main/java/org/maxkey/crypto/ReciprocalUtils.java

@@ -27,248 +27,242 @@ import org.maxkey.util.StringGenerator;
  */
 public final class ReciprocalUtils {
 
-	private static final String defaultKey 		= 	"l0JqT7NvIzP9oRaG4kFc1QmD_bWu3x8E5yS2h6"; //
+    private static final String defaultKey = "l0JqT7NvIzP9oRaG4kFc1QmD_bWu3x8E5yS2h6"; //
 
-	public final class Algorithm {
-		public static final String DES 			= 	"DES";
-		public static final String DESede 		= 	"DESede";
-		public static final String Blowfish 	= 	"Blowfish";
-		public static final String AES 			= 	"AES";
-	}
+    public final class Algorithm {
+        public static final String DES = "DES";
+        public static final String DESede = "DESede";
+        public static final String Blowfish = "Blowfish";
+        public static final String AES = "AES";
+    }
 
-	public static byte[] encode(byte[] simpleBytes, SecretKey secretKey,String algorithm) {
-		// Create the ciphers
-		Cipher ecipher;
-		byte[] byteFinal = null;
-		try {
-			ecipher = Cipher.getInstance(secretKey.getAlgorithm());
-			// Encode the string into bytes using utf-8
-			ecipher.init(Cipher.ENCRYPT_MODE, secretKey);
-			// Encrypt
-			byteFinal = ecipher.doFinal(simpleBytes);
-			return byteFinal;
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
+    public static byte[] encode(byte[] simpleBytes, SecretKey secretKey, String algorithm) {
+        // Create the ciphers
+        Cipher ecipher;
+        byte[] byteFinal = null;
+        try {
+            ecipher = Cipher.getInstance(secretKey.getAlgorithm());
+            // Encode the string into bytes using utf-8
+            ecipher.init(Cipher.ENCRYPT_MODE, secretKey);
+            // Encrypt
+            byteFinal = ecipher.doFinal(simpleBytes);
+            return byteFinal;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
 
-	/**
-	 * @param simple
-	 * @param secretKey
-	 *            must length
-	 * @return
-	 * @throws Exception
-	 */
-	public static byte[] encode(String simple, String secretKey,String algorithm) {
-		if (keyLengthCheck(secretKey, algorithm)) {
-			SecretKey key = generatorKey(secretKey, algorithm);
-			try {
-				return encode(simple.getBytes("UTF-8"), key, algorithm);
-			} catch (UnsupportedEncodingException e) {
-				e.printStackTrace();
-			}
-		}
-		return null;
-	}
+    /**
+     * @param simple
+     * @param secretKey must length
+     * @return
+     * @throws Exception
+     */
+    public static byte[] encode(String simple, String secretKey, String algorithm) {
+        if (keyLengthCheck(secretKey, algorithm)) {
+            SecretKey key = generatorKey(secretKey, algorithm);
+            try {
+                return encode(simple.getBytes("UTF-8"), key, algorithm);
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
 
-	public static byte[] decoder(byte[] ciphersBytes, SecretKey secretKey,String algorithm) {
-		Cipher cipher;
-		byte[] byteFinal = null;
-		try {
-			cipher = Cipher.getInstance(algorithm);
-			cipher.init(Cipher.DECRYPT_MODE, secretKey);
-			byteFinal = cipher.doFinal(ciphersBytes);
-			// String simple=new String(byteFinal, "UTF8" );
-			// return simple;
-			return byteFinal;
-		} catch (Exception e) {
-			e.printStackTrace();
-		} finally {
-			cipher = null;
-		}
-		return null;
-	}
+    public static byte[] decoder(byte[] ciphersBytes, SecretKey secretKey, String algorithm) {
+        Cipher cipher;
+        byte[] byteFinal = null;
+        try {
+            cipher = Cipher.getInstance(algorithm);
+            cipher.init(Cipher.DECRYPT_MODE, secretKey);
+            byteFinal = cipher.doFinal(ciphersBytes);
+            // String simple=new String(byteFinal, "UTF8" );
+            // return simple;
+            return byteFinal;
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            cipher = null;
+        }
+        return null;
+    }
 
-	public static String decoder(byte[] ciphersBytes, String secretKey,String algorithm) {
-		if (keyLengthCheck(secretKey, algorithm)) {
-			SecretKey key = generatorKey(secretKey, algorithm);
-			try {
-				return new String(decoder(ciphersBytes, key, algorithm), "UTF8");
-			} catch (UnsupportedEncodingException e) {
-				e.printStackTrace();
-			}
-		}
-		return null;
-	}
+    public static String decoder(byte[] ciphersBytes, String secretKey, String algorithm) {
+        if (keyLengthCheck(secretKey, algorithm)) {
+            SecretKey key = generatorKey(secretKey, algorithm);
+            try {
+                return new String(decoder(ciphersBytes, key, algorithm), "UTF8");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
 
-	public static byte[] encodeByDefaultKey(String simple, String algorithm) {
-		SecretKey key = generatorDefaultKey(algorithm);
-		return encode(simple.getBytes(), key, algorithm);
+    public static byte[] encodeByDefaultKey(String simple, String algorithm) {
+        SecretKey key = generatorDefaultKey(algorithm);
+        return encode(simple.getBytes(), key, algorithm);
 
-	}
+    }
 
-	public static String encode2HexByDefaultKey(String simple, String algorithm) {
-		byte[] byteFinal = encodeByDefaultKey(simple, algorithm);
+    public static String encode2HexByDefaultKey(String simple, String algorithm) {
+        byte[] byteFinal = encodeByDefaultKey(simple, algorithm);
 
-		String cipherHex = HexUtils.bytes2HexString(byteFinal);
-		return cipherHex;
-	}
+        String cipherHex = HexUtils.bytes2HexString(byteFinal);
+        return cipherHex;
+    }
 
-	public static byte[] decoderByDefaultKey(byte[] byteCiphers,String algorithm) {
-		SecretKey key = generatorDefaultKey(algorithm);
-		return decoder(byteCiphers, key, algorithm);
+    public static byte[] decoderByDefaultKey(byte[] byteCiphers, String algorithm) {
+        SecretKey key = generatorDefaultKey(algorithm);
+        return decoder(byteCiphers, key, algorithm);
 
-	}
+    }
 
-	public static String decoderHexByDefaultKey(String ciphers, String algorithm) {
-		byte[] byteSimple = HexUtils.hex2Bytes(ciphers);
-		
-		byte[] byteFinal = decoderByDefaultKey(byteSimple, algorithm);
+    public static String decoderHexByDefaultKey(String ciphers, String algorithm) {
+        byte[] byteSimple = HexUtils.hex2Bytes(ciphers);
 
-		String simple = null;
-		try {
-			simple = new String(byteFinal, "UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return simple;
+        byte[] byteFinal = decoderByDefaultKey(byteSimple, algorithm);
 
-	}
+        String simple = null;
+        try {
+            simple = new String(byteFinal, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return simple;
 
-	public static SecretKey generatorDefaultKey(String algorithm) {
-		try {
-			Security.addProvider(new com.sun.crypto.provider.SunJCE());
-			String secretKey=defaultKey;
-			if(algorithm.equals(Algorithm.DES)){
-				secretKey=defaultKey.substring(0, 8);
-			}else if(algorithm.equals(Algorithm.AES)||algorithm.equals(Algorithm.Blowfish)){
-				secretKey=defaultKey.substring(0, 16);
-			}else  if(algorithm.equals(Algorithm.DESede)){
-				secretKey=defaultKey.substring(0, 24);
-			}
-			//System.out.println("defaultKey : "+secretKey);
-			SecretKey key = new SecretKeySpec(secretKey.getBytes(), algorithm);
-			return key;
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
+    }
 
-	private static SecretKey generatorKey(String secretKey, String algorithm) {
-		try {
-			SecretKey key = new SecretKeySpec(secretKey.getBytes(), algorithm);
-			return key;
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
+    public static SecretKey generatorDefaultKey(String algorithm) {
+        try {
+            Security.addProvider(new com.sun.crypto.provider.SunJCE());
+            String secretKey = defaultKey;
+            if (algorithm.equals(Algorithm.DES)) {
+                secretKey = defaultKey.substring(0, 8);
+            } else if (algorithm.equals(Algorithm.AES) || algorithm.equals(Algorithm.Blowfish)) {
+                secretKey = defaultKey.substring(0, 16);
+            } else if (algorithm.equals(Algorithm.DESede)) {
+                secretKey = defaultKey.substring(0, 24);
+            }
+            // System.out.println("defaultKey : "+secretKey);
+            SecretKey key = new SecretKeySpec(secretKey.getBytes(), algorithm);
+            return key;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
 
-	public static String encode2Hex(String simple, String secretKey,String algorithm) {
-		if (keyLengthCheck(secretKey, algorithm)) {
-			byte[] cipher = encode(simple, secretKey, algorithm);
-			// Encode bytes to HEX to get a string
-			return HexUtils.bytes2HexString(cipher);
-		}
-		return null;
-	}
+    private static SecretKey generatorKey(String secretKey, String algorithm) {
+        try {
+            SecretKey key = new SecretKeySpec(secretKey.getBytes(), algorithm);
+            return key;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
 
-	public static String decoderHex(String ciphers, String secretKey,String algorithm) {
-		if (keyLengthCheck(secretKey, algorithm)) {
-			byte[] byteSimple = HexUtils.hex2Bytes(ciphers);
+    public static String encode2Hex(String simple, String secretKey, String algorithm) {
+        if (keyLengthCheck(secretKey, algorithm)) {
+            byte[] cipher = encode(simple, secretKey, algorithm);
+            // Encode bytes to HEX to get a string
+            return HexUtils.bytes2HexString(cipher);
+        }
+        return null;
+    }
 
-			return decoder(byteSimple, secretKey, algorithm);
-		}
-		return null;
-	}
+    public static String decoderHex(String ciphers, String secretKey, String algorithm) {
+        if (keyLengthCheck(secretKey, algorithm)) {
+            byte[] byteSimple = HexUtils.hex2Bytes(ciphers);
 
-	private static boolean keyLengthCheck(String secretKey, String algorithm) {
-		boolean lengthCheck = false;
-		if (algorithm.equals(Algorithm.DES)) {
-			if (secretKey.length() == 8) {
-				lengthCheck = true;
-			} else {
-				LogFactory.getLog(ReciprocalUtils.class).debug(
-						"key length is " + secretKey.getBytes().length
-								+ " ,must lequal 8");
-			}
-		} else if (algorithm.equals(Algorithm.DESede)) {
-			if (secretKey.length() == 24) {
-				lengthCheck = true;
-			} else {
-				LogFactory.getLog(ReciprocalUtils.class).debug(
-						"key length is " + secretKey.getBytes().length
-								+ " ,must equal 24");
-			}
-		} else if (algorithm.equals(Algorithm.AES)) {
-			if (secretKey.length() == 16) {
-				lengthCheck = true;
-			} else {
-				LogFactory.getLog(ReciprocalUtils.class).debug(
-						"key length is " + secretKey.getBytes().length
-								+ " ,must equal 16");
-			}
-		} else if (algorithm.equals(Algorithm.Blowfish)) {
-			if (secretKey.length() <= 16) {
-				lengthCheck = true;
-			} else {
-				LogFactory.getLog(ReciprocalUtils.class).debug(
-						"key length is " + secretKey.getBytes().length
-								+ " ,must be less then 16");
-			}
-		}
-		return lengthCheck;
-	}
+            return decoder(byteSimple, secretKey, algorithm);
+        }
+        return null;
+    }
 
-	/**
-	 * @param simple
-	 * @param secretKey
-	 *            must length is 16
-	 * @return
-	 */
-	public static String aesEncode(String simple, String secretKey) {
-		return encode2Hex(simple, secretKey, Algorithm.AES);
-	}
+    private static boolean keyLengthCheck(String secretKey, String algorithm) {
+        boolean lengthCheck = false;
+        if (algorithm.equals(Algorithm.DES)) {
+            if (secretKey.length() == 8) {
+                lengthCheck = true;
+            } else {
+                LogFactory.getLog(ReciprocalUtils.class)
+                        .debug("key length is " + secretKey.getBytes().length + " ,must lequal 8");
+            }
+        } else if (algorithm.equals(Algorithm.DESede)) {
+            if (secretKey.length() == 24) {
+                lengthCheck = true;
+            } else {
+                LogFactory.getLog(ReciprocalUtils.class)
+                        .debug("key length is " + secretKey.getBytes().length + " ,must equal 24");
+            }
+        } else if (algorithm.equals(Algorithm.AES)) {
+            if (secretKey.length() == 16) {
+                lengthCheck = true;
+            } else {
+                LogFactory.getLog(ReciprocalUtils.class)
+                        .debug("key length is " + secretKey.getBytes().length + " ,must equal 16");
+            }
+        } else if (algorithm.equals(Algorithm.Blowfish)) {
+            if (secretKey.length() <= 16) {
+                lengthCheck = true;
+            } else {
+                LogFactory.getLog(ReciprocalUtils.class)
+                        .debug("key length is " + secretKey.getBytes().length + " ,must be less then 16");
+            }
+        }
+        return lengthCheck;
+    }
 
-	public static String aesDecoder(String ciphers, String secretKey) {
-		return decoderHex(ciphers, secretKey, Algorithm.AES);
-	}
+    /**
+     * @param simple
+     * @param secretKey must length is 16
+     * @return
+     */
+    public static String aesEncode(String simple, String secretKey) {
+        return encode2Hex(simple, secretKey, Algorithm.AES);
+    }
 
-	/**
-	 * encode by defaultKey with Algorithm.AES
-	 * 
-	 * @param simple
-	 * @return Hex
-	 */
-	public static String encode(String simple) {
-		return encode2HexByDefaultKey(simple, Algorithm.AES);
-	}
+    public static String aesDecoder(String ciphers, String secretKey) {
+        return decoderHex(ciphers, secretKey, Algorithm.AES);
+    }
 
-	/**
-	 * decoder by defaultKey with Algorithm.AES
-	 * 
-	 * @param ciphers is HEX
-	 *            
-	 * @return
-	 */
-	public static String decoder(String ciphers) {
-		return decoderHexByDefaultKey(ciphers, Algorithm.AES);
-	}
+    /**
+     * encode by defaultKey with Algorithm.AES
+     * 
+     * @param simple
+     * @return Hex
+     */
+    public static String encode(String simple) {
+        return encode2HexByDefaultKey(simple, Algorithm.AES);
+    }
 
-	public static String generateKey(String algorithm) {
-		if (algorithm.equals(Algorithm.DES)) {
-			return (new StringGenerator(8)).randomGenerate();
-		} else if (algorithm.equals(Algorithm.AES)) {
-			return (new StringGenerator(16)).randomGenerate();
-		} else if (algorithm.equals(Algorithm.Blowfish)) {
-			return (new StringGenerator(16)).randomGenerate();
-		} else if (algorithm.equals(Algorithm.DESede)) {
-			return (new StringGenerator(24)).randomGenerate();
-		} else {
-			return (new StringGenerator()).uniqueGenerate();
-		}
-	}
+    /**
+     * decoder by defaultKey with Algorithm.AES
+     * 
+     * @param ciphers is HEX
+     * 
+     * @return
+     */
+    public static String decoder(String ciphers) {
+        return decoderHexByDefaultKey(ciphers, Algorithm.AES);
+    }
+
+    public static String generateKey(String algorithm) {
+        if (algorithm.equals(Algorithm.DES)) {
+            return (new StringGenerator(8)).randomGenerate();
+        } else if (algorithm.equals(Algorithm.AES)) {
+            return (new StringGenerator(16)).randomGenerate();
+        } else if (algorithm.equals(Algorithm.Blowfish)) {
+            return (new StringGenerator(16)).randomGenerate();
+        } else if (algorithm.equals(Algorithm.DESede)) {
+            return (new StringGenerator(24)).randomGenerate();
+        } else {
+            return (new StringGenerator()).uniqueGenerate();
+        }
+    }
 }

+ 290 - 396
maxkey-core/src/main/java/org/maxkey/domain/apps/AppsSAML20Details.java

@@ -14,401 +14,295 @@ import org.springframework.web.multipart.MultipartFile;
  * @author Crystal.Sea
  *
  */
-@Table(name = "APPS_SAML_V20_DETAILS")  
-public class AppsSAML20Details   extends Apps {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -291159876339333345L;
-	@Id
-	@Column
-	@GeneratedValue(strategy=GenerationType.AUTO,generator="uuid")
-	protected String id;
-	@Column
-	private String certIssuer;
-	@Column
-	private String certSubject;
-	@Column
-	private String certExpiration;
-	@Column
-	private byte[] keyStore;
-	
-	private String entityId;
-	@Column
-	private String spAcsUrl;
-	@Column
-	private String issuer;
-	@Column
-	private String audience;
-	@Column
-	private String nameidFormat;
-	@Column
-	private String validityInterval;
-	/**
-	 * Redirect-Post
-	 * Post-Post
-	 * IdpInit-Post
-	 * Redirect-PostSimpleSign
-	 * Post-PostSimpleSign
-	 * IdpInit-PostSimpleSign
-	 */
-	@Column
-	private String binding;
-
-	/**
-	 * 0  false
-	 * 1  true
-	 */
-	@Column
-	private int encrypted;
-	
-	/**
-	 * for upload
-	 */
-	private MultipartFile certMetaFile;
-	/**
-	 * metadata or certificate
-	 */
-	private String fileType;
-	
-	/**
-	 * 0 original
-	 * 1 uppercase
-	 * 2 lowercase
-	 */
-	@Column
-	private int nameIdConvert;
-
-	
-	public static class BINDINGTYPE{
-		public String Redirect_Post="Redirect-Post";
-		public String Post_Post="Post-Post";
-		public String IdpInit_Post="IdpInit-Post";
-		public String Redirect_PostSimpleSign="Redirect-PostSimpleSign";
-		public String Post_PostSimpleSign="Post-PostSimpleSign";
-		public String IdpInit_PostSimpleSign="IdpInit-PostSimpleSign";
-	}
-
-	
-	
-	/**
-	 * 
-	 */
-	public AppsSAML20Details() {
-		super();
-
-	}
-
-
-	public String getId() {
-		return id;
-	}
-
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-
-	/**
-	 * @return the certIssuer
-	 */
-	public String getCertIssuer() {
-		return certIssuer;
-	}
-
-
-
-
-	/**
-	 * @param certIssuer the certIssuer to set
-	 */
-	public void setCertIssuer(String certIssuer) {
-		this.certIssuer = certIssuer;
-	}
-
-
-
-
-	/**
-	 * @return the certSubject
-	 */
-	public String getCertSubject() {
-		return certSubject;
-	}
-
-
-
-
-	/**
-	 * @param certSubject the certSubject to set
-	 */
-	public void setCertSubject(String certSubject) {
-		this.certSubject = certSubject;
-	}
-
-
-
-
-	/**
-	 * @return the certExpiration
-	 */
-	public String getCertExpiration() {
-		return certExpiration;
-	}
-
-
-
-
-	/**
-	 * @param certExpiration the certExpiration to set
-	 */
-	public void setCertExpiration(String certExpiration) {
-		this.certExpiration = certExpiration;
-	}
-
-
-
-
-	/**
-	 * @return the keyStore
-	 */
-	public byte[] getKeyStore() {
-		return keyStore;
-	}
-
-
-
-
-	/**
-	 * @param keyStore the keyStore to set
-	 */
-	public void setKeyStore(byte[] keyStore) {
-		this.keyStore = keyStore;
-	}
-
-
-
-
-	/**
-	 * @return the entityId
-	 */
-	public String getEntityId() {
-		return entityId;
-	}
-
-
-
-
-	/**
-	 * @param entityId the entityId to set
-	 */
-	public void setEntityId(String entityId) {
-		this.entityId = entityId;
-	}
-
-
-
-
-	/**
-	 * @return the spAcsUrl
-	 */
-	public String getSpAcsUrl() {
-		return spAcsUrl;
-	}
-
-
-
-
-	/**
-	 * @param spAcsUrl the spAcsUrl to set
-	 */
-	public void setSpAcsUrl(String spAcsUrl) {
-		this.spAcsUrl = spAcsUrl;
-	}
-
-
-
-
-	/**
-	 * @return the issuer
-	 */
-	public String getIssuer() {
-		return issuer;
-	}
-
-
-
-
-	/**
-	 * @param issuer the issuer to set
-	 */
-	public void setIssuer(String issuer) {
-		this.issuer = issuer;
-	}
-
-
-
-
-
-	/**
-	 * @return the audience
-	 */
-	public String getAudience() {
-		return audience;
-	}
-
-
-
-
-	/**
-	 * @param audience the audience to set
-	 */
-	public void setAudience(String audience) {
-		this.audience = audience;
-	}
-
-
-
-
-	/**
-	 * @return the nameidFormat
-	 */
-	public String getNameidFormat() {
-		return nameidFormat;
-	}
-
-
-
-
-	/**
-	 * @param nameidFormat the nameidFormat to set
-	 */
-	public void setNameidFormat(String nameidFormat) {
-		this.nameidFormat = nameidFormat;
-	}
-
-
-
-
-	/**
-	 * @return the validityInterval
-	 */
-	public String getValidityInterval() {
-		return validityInterval;
-	}
-
-
-
-
-	/**
-	 * @param validityInterval the validityInterval to set
-	 */
-	public void setValidityInterval(String validityInterval) {
-		this.validityInterval = validityInterval;
-	}
-
-
-
-
-	/**
-	 * @return the certMetaFile
-	 */
-	public MultipartFile getCertMetaFile() {
-		return certMetaFile;
-	}
-
-
-
-
-	/**
-	 * @param certMetaFile the certMetaFile to set
-	 */
-	public void setCertMetaFile(MultipartFile certMetaFile) {
-		this.certMetaFile = certMetaFile;
-	}
-
-
-
-
-	/**
-	 * @return the fileType
-	 */
-	public String getFileType() {
-		return fileType;
-	}
-
-
-
-
-	/**
-	 * @param fileType the fileType to set
-	 */
-	public void setFileType(String fileType) {
-		this.fileType = fileType;
-	}
-
-
-
-
-	public String getBinding() {
-		return binding;
-	}
-
-
-
-
-	public void setBinding(String binding) {
-		this.binding = binding;
-	}
-
-
-	public int getEncrypted() {
-		return encrypted;
-	}
-
-
-
-
-	public void setEncrypted(int encrypted) {
-		this.encrypted = encrypted;
-	}
-
-
-
-
-	public int getNameIdConvert() {
-		return nameIdConvert;
-	}
-
-
-
-
-	public void setNameIdConvert(int nameIdConvert) {
-		this.nameIdConvert = nameIdConvert;
-	}
-
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-		return "SAMLBaseDetails [certIssuer=" + certIssuer + ", certSubject="
-				+ certSubject + ", certExpiration=" + certExpiration
-				+ ", keyStore=" + Arrays.toString(keyStore) + ", entityId="
-				+ entityId + ", spAcsUrl=" + spAcsUrl + ", issuer=" + issuer
-				+ ", audience=" + audience + ", nameidFormat=" + nameidFormat
-				+ ", validityInterval=" + validityInterval + ", binding="
-				+ binding + ", encrypted=" + encrypted + ", certMetaFile="
-				+ certMetaFile + ", fileType=" + fileType + ", nameIdConvert="
-				+ nameIdConvert + "]";
-	}
-	
-
-	
-	
-
+@Table(name = "APPS_SAML_V20_DETAILS")
+public class AppsSAML20Details extends Apps {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -291159876339333345L;
+    @Id
+    @Column
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid")
+    protected String id;
+    @Column
+    private String certIssuer;
+    @Column
+    private String certSubject;
+    @Column
+    private String certExpiration;
+    @Column
+    private byte[] keyStore;
+    @Column
+    private String entityId;
+    @Column
+    private String spAcsUrl;
+    @Column
+    private String issuer;
+    @Column
+    private String audience;
+    @Column
+    private String nameidFormat;
+    @Column
+    private String validityInterval;
+    /**
+     * Redirect-Post Post-Post IdpInit-Post Redirect-PostSimpleSign
+     * Post-PostSimpleSign IdpInit-PostSimpleSign
+     */
+    @Column
+    private String binding;
+
+    /**
+     * 0 false 1 true
+     */
+    @Column
+    private int encrypted;
+
+    /**
+     * for upload
+     */
+    private MultipartFile certMetaFile;
+    /**
+     * metadata or certificate
+     */
+    private String fileType;
+
+    /**
+     * 0 original 1 uppercase 2 lowercase
+     */
+    @Column
+    private int nameIdConvert;
+
+    public static class BINDINGTYPE {
+        public String Redirect_Post = "Redirect-Post";
+        public String Post_Post = "Post-Post";
+        public String IdpInit_Post = "IdpInit-Post";
+        public String Redirect_PostSimpleSign = "Redirect-PostSimpleSign";
+        public String Post_PostSimpleSign = "Post-PostSimpleSign";
+        public String IdpInit_PostSimpleSign = "IdpInit-PostSimpleSign";
+    }
+
+    /**
+     * 
+     */
+    public AppsSAML20Details() {
+        super();
+
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    /**
+     * @return the certIssuer
+     */
+    public String getCertIssuer() {
+        return certIssuer;
+    }
+
+    /**
+     * @param certIssuer the certIssuer to set
+     */
+    public void setCertIssuer(String certIssuer) {
+        this.certIssuer = certIssuer;
+    }
+
+    /**
+     * @return the certSubject
+     */
+    public String getCertSubject() {
+        return certSubject;
+    }
+
+    /**
+     * @param certSubject the certSubject to set
+     */
+    public void setCertSubject(String certSubject) {
+        this.certSubject = certSubject;
+    }
+
+    /**
+     * @return the certExpiration
+     */
+    public String getCertExpiration() {
+        return certExpiration;
+    }
+
+    /**
+     * @param certExpiration the certExpiration to set
+     */
+    public void setCertExpiration(String certExpiration) {
+        this.certExpiration = certExpiration;
+    }
+
+    /**
+     * @return the keyStore
+     */
+    public byte[] getKeyStore() {
+        return keyStore;
+    }
+
+    /**
+     * @param keyStore the keyStore to set
+     */
+    public void setKeyStore(byte[] keyStore) {
+        this.keyStore = keyStore;
+    }
+
+    /**
+     * @return the entityId
+     */
+    public String getEntityId() {
+        return entityId;
+    }
+
+    /**
+     * @param entityId the entityId to set
+     */
+    public void setEntityId(String entityId) {
+        this.entityId = entityId;
+    }
+
+    /**
+     * @return the spAcsUrl
+     */
+    public String getSpAcsUrl() {
+        return spAcsUrl;
+    }
+
+    /**
+     * @param spAcsUrl the spAcsUrl to set
+     */
+    public void setSpAcsUrl(String spAcsUrl) {
+        this.spAcsUrl = spAcsUrl;
+    }
+
+    /**
+     * @return the issuer
+     */
+    public String getIssuer() {
+        return issuer;
+    }
+
+    /**
+     * @param issuer the issuer to set
+     */
+    public void setIssuer(String issuer) {
+        this.issuer = issuer;
+    }
+
+    /**
+     * @return the audience
+     */
+    public String getAudience() {
+        return audience;
+    }
+
+    /**
+     * @param audience the audience to set
+     */
+    public void setAudience(String audience) {
+        this.audience = audience;
+    }
+
+    /**
+     * @return the nameidFormat
+     */
+    public String getNameidFormat() {
+        return nameidFormat;
+    }
+
+    /**
+     * @param nameidFormat the nameidFormat to set
+     */
+    public void setNameidFormat(String nameidFormat) {
+        this.nameidFormat = nameidFormat;
+    }
+
+    /**
+     * @return the validityInterval
+     */
+    public String getValidityInterval() {
+        return validityInterval;
+    }
+
+    /**
+     * @param validityInterval the validityInterval to set
+     */
+    public void setValidityInterval(String validityInterval) {
+        this.validityInterval = validityInterval;
+    }
+
+    /**
+     * @return the certMetaFile
+     */
+    public MultipartFile getCertMetaFile() {
+        return certMetaFile;
+    }
+
+    /**
+     * @param certMetaFile the certMetaFile to set
+     */
+    public void setCertMetaFile(MultipartFile certMetaFile) {
+        this.certMetaFile = certMetaFile;
+    }
+
+    /**
+     * @return the fileType
+     */
+    public String getFileType() {
+        return fileType;
+    }
+
+    /**
+     * @param fileType the fileType to set
+     */
+    public void setFileType(String fileType) {
+        this.fileType = fileType;
+    }
+
+    public String getBinding() {
+        return binding;
+    }
+
+    public void setBinding(String binding) {
+        this.binding = binding;
+    }
+
+    public int getEncrypted() {
+        return encrypted;
+    }
+
+    public void setEncrypted(int encrypted) {
+        this.encrypted = encrypted;
+    }
+
+    public int getNameIdConvert() {
+        return nameIdConvert;
+    }
+
+    public void setNameIdConvert(int nameIdConvert) {
+        this.nameIdConvert = nameIdConvert;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return "SAMLBaseDetails [certIssuer=" + certIssuer + ", certSubject=" + certSubject + ", certExpiration="
+                + certExpiration + ", keyStore=" + Arrays.toString(keyStore) + ", entityId=" + entityId + ", spAcsUrl="
+                + spAcsUrl + ", issuer=" + issuer + ", audience=" + audience + ", nameidFormat=" + nameidFormat
+                + ", validityInterval=" + validityInterval + ", binding=" + binding + ", encrypted=" + encrypted
+                + ", certMetaFile=" + certMetaFile + ", fileType=" + fileType + ", nameIdConvert=" + nameIdConvert
+                + "]";
+    }
 
 }

+ 2 - 0
maxkey-dao/.classpath

@@ -16,12 +16,14 @@
 		<attributes>
 			<attribute name="gradle_scope" value="test"/>
 			<attribute name="gradle_used_by_scope" value="test"/>
+			<attribute name="test" value="true"/>
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="src" output="bin/test" path="src/test/resources">
 		<attributes>
 			<attribute name="gradle_scope" value="test"/>
 			<attribute name="gradle_used_by_scope" value="test"/>
+			<attribute name="test" value="true"/>
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>

+ 1 - 0
maxkey-protocols/maxkey-protocol-cas/.classpath

@@ -10,6 +10,7 @@
 		<attributes>
 			<attribute name="gradle_scope" value="test"/>
 			<attribute name="gradle_used_by_scope" value="test"/>
+			<attribute name="test" value="true"/>
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>

+ 11 - 0
maxkey-protocols/maxkey-protocol-oauth-2.0/.settings/org.eclipse.jdt.core.prefs

@@ -8,9 +8,20 @@ org.eclipse.jdt.core.circularClasspath=warning
 org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
 org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
 org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
 org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=disabled
 org.eclipse.jdt.core.compiler.source=1.8
 org.eclipse.jdt.core.incompatibleJDKLevel=ignore
 org.eclipse.jdt.core.incompleteClasspath=error

+ 1 - 1
maxkey-web-manage/.project

@@ -4,8 +4,8 @@
 	<comment>maxkey-web-manage</comment>
 	<projects>
 		<project>maxkey-protocol-authorize</project>
-		<project>maxkey-core</project>
 		<project>maxkey-jose-jwt</project>
+		<project>maxkey-core</project>
 		<project>maxkey-dao</project>
 		<project>maxkey-client-sdk</project>
 		<project>maxkey-protocol-oauth-2.0</project>

+ 11 - 0
maxkey-web-manage/.settings/org.eclipse.jdt.core.prefs

@@ -8,9 +8,20 @@ org.eclipse.jdt.core.circularClasspath=warning
 org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
 org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
 org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
 org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=disabled
 org.eclipse.jdt.core.compiler.source=1.8
 org.eclipse.jdt.core.incompatibleJDKLevel=ignore
 org.eclipse.jdt.core.incompleteClasspath=error

+ 5 - 5
maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsAdd.ftl

@@ -25,7 +25,7 @@
 			<tr>
 				<th><@locale code="userinfo.username" />:</th>
 				<td nowrap>
-					<input readonly type="text" id="username" name="username"  class="form-control username" title="" value="${model.username!}" style="float:left;width:70%;"/>
+					<input readonly type="text" id="username" name="username"  class="form-control username" title="" value="${model.username!}" style="float:left;width:70%;"  required="" />
 					<input class="button btn btn-primary mr-3 window"  type="button"    id="selectUserinfoBtn" value="<@locale code="button.text.select" />"
 					 wurl="<@base/>/userinfo/select"
 						 		    wwidth="800"
@@ -37,14 +37,14 @@
 			<tr>
 				<th><@locale code="userinfo.displayName" />:</th>
 				<td nowrap>
-					<input readonly  type="text" id="displayName" name="displayName"  class="form-control displayName"  title="" value="${model.displayName!}" style="width:70%;"/>
+					<input readonly  type="text" id="displayName" name="displayName"  class="form-control displayName"  title="" value="${model.displayName!}" style="width:70%;"  required="" />
 			
 				</td>
 			</tr>
 			<tr>
 				<th><@locale code="apps.name" />:</th>
 				<td nowrap>
-					<input readonly  type="text" id="appName" name="appName"  class="form-control appName" title="" value="${model.appName!}"  style="float:left;width:70%;"/>
+					<input readonly  type="text" id="appName" name="appName"  class="form-control appName" title="" value="${model.appName!}"  style="float:left;width:70%;"  required="" />
 					<input class="button btn btn-primary mr-3 window"  type="button"    id="selectAppsubmitBtn" value="<@locale code="button.text.select" />"
 					  wurl="<@base/>/apps/select"
 						 		    wwidth="800"
@@ -56,14 +56,14 @@
 			<tr>
 				<th><@locale code="account.relatedUsername" />:</th>
 				<td nowrap>
-					<input type="text" id="relatedUsername" name="relatedUsername"  class="form-control" title="" value="${model.relatedUsername!}"  style="width:70%;"/>
+					<input type="text" id="relatedUsername" name="relatedUsername"  class="form-control" title="" value="${model.relatedUsername!}"  style="width:70%;"  required="" />
 
 				</td>
 			</tr>
 			<tr>
 				<th><@locale code="account.relatedPassword" />:</th>
 				<td nowrap>
-					<input type="password" id="relatedPassword" name="relatedPassword"  class="form-control" title="" value="${model.relatedPassword!}"  style="width:70%;"/>
+					<input type="password" id="relatedPassword" name="relatedPassword"  class="form-control" title="" value="${model.relatedPassword!}"  style="width:70%;"  required="" />
 		
 				</td>
 			</tr>

+ 4 - 6
maxkey-web-manage/src/main/resources/templates/views/apps/appAddCommon.ftl

@@ -20,13 +20,13 @@
        <tr>
          <th><@locale code="apps.name"/>:</th>
          <td colspan="3">
-            <input type="text"class="form-control"  id="name" name="name"  size="100"  title="" value=""/>
+            <input type="text"class="form-control"  id="name" name="name"  size="100"  title="" value=""  required=""   />
          </td>
       </tr>
       <tr>
          <th><@locale code="apps.loginUrl"/>:</th>
          <td colspan="3">
-            <input type="text" class="form-control"  id="loginUrl" name="loginUrl" size="100"  title="" value=""/>
+            <input type="text" class="form-control"  id="loginUrl" name="loginUrl" size="100"  title="" value=""  required=""   />
          </td>
       </tr>
       <tr>
@@ -37,9 +37,7 @@
          </td>
          <th style="width:15%;"><@locale code="apps.category"/>:</th>
          <td style="width:35%;">
-         	<select name="category"  class="form-control" >
-			
-			</select>
+            <input type="text"class="form-control"  id="category" name="category"  title="" value="${model.category!}"/>
          </td>
       </tr>
       <tr>
@@ -49,7 +47,7 @@
          </td>
          <th><@locale code="common.text.sortindex"/></th>
          <td>
-         	<input  type="text" id="sortOrder" class="form-control"  name="sortOrder"  title="" value="0"/>
+         	<input  type="text" id="sortOrder" class="form-control"  name="sortOrder"  title="" value="1"  required=""    />
          </td>
       </tr>
       <tr>

+ 4 - 6
maxkey-web-manage/src/main/resources/templates/views/apps/appUpdateCommon.ftl

@@ -33,13 +33,13 @@
       <tr>
          <th><@locale code="apps.name"/>:</th>
          <td  colspan="3">
-            <input type="text" class="form-control" id="name" name="name"  title="" value="${model.name!}"/>
+            <input type="text" class="form-control" id="name" name="name"  title="" value="${model.name!}"  required="" />
          </td>
       </tr>
       <tr>
          <th><@locale code="apps.loginUrl"/>:</th>
          <td colspan="3">
-            <input type="text" class="form-control" id="loginUrl" name="loginUrl"  title="" value="${model.loginUrl!}"/>
+            <input type="text" class="form-control" id="loginUrl" name="loginUrl"  title="" value="${model.loginUrl!}"  required="" />
          </td>
       </tr>
       <tr>
@@ -49,9 +49,7 @@
          </td>
          <th><@locale code="apps.category"/>:</th>
          <td>
-            <select name="category"  class="select_t">
-				
-			</select>
+            <input type="text"class="form-control"  id="category" name="category"  title="" value="${model.category!}"/>
          </td>
       </tr>
       <tr>
@@ -60,7 +58,7 @@
          </td>
          <th><@locale code="common.text.sortindex"/></th>
          <td>
-         	<input  type="text" class="form-control" id="sortIndex" name="sortIndex"  title="" value="${model.sortIndex!}"/>
+         	<input  type="text" class="form-control" id="sortIndex" name="sortIndex"  title="" value="${model.sortIndex!}"  required="" />
          </td>
       </tr>
       <tr>

+ 3 - 3
maxkey-web-manage/src/main/resources/templates/views/apps/appsExtendAttr.ftl

@@ -22,15 +22,15 @@ $(function(){
 		html +=			'</th>';  
 		//attribute
 		html +=			'<td>';   
-		html += 			'<input type="text" class="form-control" id="attribute_' + attrIndex + '" name="attr" class="int" title="" value="'+attribute+'"/>';   
+		html += 			'<input type="text" class="form-control" id="attribute_' + attrIndex + '" name="attr" class="int" title="" value="'+attribute+'"  required="" />';   
         html += 		'</span></td>';
         //attributeType
         html += 		'<th  nowrap ><@locale code="apps.extendAttr.parameter.type"/>:</th>	<td><span class="intspan">';
-        html += 			'<input type="text"  class="form-control" id="attributeType_' + attrIndex + '" name="type" class="int" title="" value="'+attributeType+'"/>';
+        html += 			'<input type="text"  class="form-control" id="attributeType_' + attrIndex + '" name="type" class="int" title="" value="'+attributeType+'"  required="" />';
         html += 		'</span></td>';
 		//attributeValue   
         html += 		'<th  nowrap ><@locale code="apps.extendAttr.parameter.value"/>:</th>	<td><span class="intspan">';
-        html += 			'<input type="text"  class="form-control" id="attributeValue_' + attrIndex + '" name="value" class="int" title="" value="'+attributeValue+'"/>';
+        html += 			'<input type="text"  class="form-control" id="attributeValue_' + attrIndex + '" name="value" class="int" title="" value="'+attributeValue+'"  required="" />';
         html += 		'</span></td>';
        
         html += '</tr>'; 

+ 2 - 4
maxkey-web-manage/src/main/resources/templates/views/apps/cas/appAdd.ftl

@@ -47,15 +47,13 @@ $(function(){
 							<tr>
 								<th style="width:15%;"><@locale code="apps.cas.service"/>:</th>
 								<td  colspan=3>
-									<input type="text" id="service" class="form-control" name="service"  title="" value=""/>
-									<b class="orange">*</b><label for="service"></label>
+									<input type="text" id="service" class="form-control" name="service"  title="" value=""  required=""    />
 								</td>
 							</tr>
 							<tr>
 								<th style="width:15%;"><@locale code="apps.cas.validation"/>:</th>
 								<td  colspan=3>
-									<input type="text" class="form-control" id="validation" name="validation"  title="" value=""/>
-									<b class="orange">*</b><label for="validation"></label>
+									<input type="text" class="form-control" id="validation" name="validation"  title="" value=""  required=""  />
 								</td>
 							</tr>
 							<tr>

+ 2 - 2
maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl

@@ -57,13 +57,13 @@ $(function(){
 								<tr>
 									<th style="width:15%;"><@locale code="apps.cas.service"/>:</th>
 									<td  colspan=3>
-										<input type="text" class="form-control" id="service" name="service"  title="" value="${model.service}"/>
+										<input type="text" class="form-control" id="service" name="service"  title="" value="${model.service}"  required=""   />
 									</td>
 								</tr>
 								<tr>
 									<th style="width:15%;"><@locale code="apps.cas.validation"/>:</th>
 									<td  colspan=3>
-										<input type="text" class="form-control" id="redirectUri" name="validation"  title="" value="${model.validation}"/>
+										<input type="text" class="form-control" id="redirectUri" name="validation"  title="" value="${model.validation}"  required="" />
 							
 									</td>
 								</tr>

+ 3 - 3
maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl

@@ -86,7 +86,7 @@ $(function(){
 				<tr>
 					<th ><@locale code="apps.desktop.programPath" />:</th>
 					<td colspan="3">
-						<textarea  id="programPath" name="programPath" rows="4" cols="60" class="form-control" ></textarea>
+						<textarea  id="programPath" name="programPath" rows="4" cols="60" class="form-control"  required=""  ></textarea>
 						<b class="orange">*</b><label for="programPath"></label>
 					</td>
 					
@@ -110,7 +110,7 @@ $(function(){
 					</td>
 					<th class="usernameParameter"  style="display:none"><@locale code="apps.desktop.usernameParameter" />:</th>
 					<td class="usernameParameter"  style="display:none">
-						<input type="text" id="usernameParameter" name="usernameParameter"  title="" value="username" class="form-control" />
+						<input type="text" id="usernameParameter" name="usernameParameter"  title="" value="username" class="form-control"  />
 						<b class="orange">*</b><label for="usernameParameter"></label>
 					</td>
 					
@@ -132,7 +132,7 @@ $(function(){
 					</td>
 					<th   class="passwordParameter" style="display:none"><@locale code="apps.desktop.passwordParameter" />:</th>
 					<td   class="passwordParameter" style="display:none">
-						<input type="text" id="passwordParameter" name="passwordParameter"  title="" value="password" class="form-control" />
+						<input type="text" id="passwordParameter" name="passwordParameter"  title="" value="password" class="form-control"    />
 						<b class="orange">*</b><label for="passwordParameter"></label>
 					</td>
 					

+ 3 - 3
maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl

@@ -93,7 +93,7 @@ $(function(){
 				<tr>
 					<th><@locale code="apps.desktop.programPath" />:</th>
 					<td colspan="3">
-						<textarea class="form-control" id="programPath" name="programPath" rows="4" cols="60">${model.programPath}</textarea>
+						<textarea class="form-control" id="programPath" name="programPath" rows="4" cols="60"  required="" >${model.programPath}</textarea>
 						
 					</td>
 					
@@ -117,7 +117,7 @@ $(function(){
 					<th  class="usernameParameter" <#if 'SIMULATION'==model.usernameType>style="display:none"</#if> >
 						<@locale code="apps.desktop.usernameParameter" />:</th>
 					<td  class="usernameParameter" <#if 'SIMULATION'==model.usernameType>style="display:none"</#if> >
-						<input type="text" class="form-control" id="usernameParameter" name="usernameParameter"  title="" value="${model.usernameParameter}"/>
+						<input type="text" class="form-control" id="usernameParameter" name="usernameParameter"  title="" value="${model.usernameParameter}"  />
 						
 					</td>
 					
@@ -141,7 +141,7 @@ $(function(){
 					<th   class="passwordParameter" <#if 'SIMULATION'==model.passwordType>style="display:none"</#if>  >
 						<@locale code="apps.desktop.passwordParameter" />:</th>
 					<td   class="passwordParameter" <#if 'SIMULATION'==model.passwordType>style="display:none"</#if> >
-						<input type="text" class="form-control" id="passwordParameter" name="passwordParameter"  title="" value="${model.passwordParameter}"/>
+						<input type="text" class="form-control" id="passwordParameter" name="passwordParameter"  title="" value="${model.passwordParameter}"  />
 						
 					</td>
 					

+ 4 - 6
maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl

@@ -33,8 +33,8 @@ $(function(){
 </head>
 <body>
 <form id="actionForm_app"  method="post" type="label" autoclose="true"  
-   action="<s:Base/>/apps/extendapi/add"  
-   forward="<s:Base/>/apps/list"
+   action="<@base/>/apps/extendapi/add"  
+   forward="<@base/>/apps/list"
    enctype="multipart/form-data">
    <!-- content -->    
    <!--table-->
@@ -50,13 +50,11 @@ $(function(){
 				<tr>
 					<th  ><@locale code="apps.principal"/>:</th>
 					<td  >
-						<input  class="form-control" type="text" id="principal" name="principal"  title="" value=""/>
-						<b class="orange">*</b><label for="principal"></label>
+						<input  class="form-control" type="text" id="principal" name="principal"  title="" value=""  required=""  />
 					</td>
 					<th  ><@locale code="apps.credentials"/>:</th>
 					<td  >
-						<input class="form-control" type="text" id="credentials" name="credentials"  title="" value=""/>
-						<b class="orange">*</b><label for="credentials"></label>
+						<input class="form-control" type="text" id="credentials" name="credentials"  title="" value=""  required=""   />
 					</td>
 				</tr>
 				<tr>

+ 2 - 2
maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appUpdate.ftl

@@ -54,12 +54,12 @@ $(function(){
 				<tr>
 					<th  ><@locale code="apps.principal"/>:</th>
 					<td  >
-						<input type="text"  class="form-control"  id="principal" name="principal"  title="" value="${model.principal}"/>
+						<input type="text"  class="form-control"  id="principal" name="principal"  title="" value="${model.principal}"  required=""   />
 						
 					</td>
 					<th  ><@locale code="apps.credentials"/>:</th>
 					<td  >
-						<input type="text" class="form-control"  id="credentials" name="credentials"  title="" value="${model.credentials}"/>
+						<input type="text" class="form-control"  id="credentials" name="credentials"  title="" value="${model.credentials}"  required=""  />
 						
 					</td>
 				</tr>

+ 3 - 3
maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appAdd.ftl

@@ -53,7 +53,7 @@ $(function(){
 				<tr>
 					<th><@locale code="apps.formbased.redirectUri"/>:</th>
 					<td colspan="3">
-						<input type="text"  class="form-control"  id="redirectUri" name="redirectUri"  title="" value=""/>
+						<input type="text"  class="form-control"  id="redirectUri" name="redirectUri"  title="" value=""  required="" />
 						<b class="orange">*</b><label for="redirectUri"></label>
 					</td>
 					
@@ -61,12 +61,12 @@ $(function(){
 				<tr>
 					<th style="width:15%;"><@locale code="apps.formbased.usernameMapping"/>:</th>
 					<td style="width:35%;">
-						<input type="text"  class="form-control"  id="usernameMapping" name="usernameMapping"  title="" value="username"/>
+						<input type="text"  class="form-control"  id="usernameMapping" name="usernameMapping"  title="" value="username"  required="" />
 						<b class="orange">*</b><label for="usernameMapping"></label>
 					</td>
 					<th style="width:15%;"><@locale code="apps.formbased.passwordMapping"/>:</th>
 					<td style="width:35%;">
-						<input type="text"  class="form-control" id="passwordMapping" name="passwordMapping"  title="" value="password"/>
+						<input type="text"  class="form-control" id="passwordMapping" name="passwordMapping"  title="" value="password"  required=""  />
 						<b class="orange">*</b><label for="passwordMapping"></label>
 					</td>
 				</tr>

+ 4 - 4
maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appUpdate.ftl

@@ -58,19 +58,19 @@ $(function(){
 				<tr>
 					<th><@locale code="apps.formbased.redirectUri"/>:</th>
 					<td colspan="3">
-						<input type="text" class="form-control" id="redirectUri" name="redirectUri"  title="" value="${model.redirectUri}"/>
+						<input type="text" class="form-control" id="redirectUri" name="redirectUri"  title="" value="${model.redirectUri}"  required=""   />
 					</td>
 					
-				</tr>
+				</tr> 
 				
 				<tr>
 					<th style="width:15%;"><@locale code="apps.formbased.usernameMapping"/>:</th>
 					<td style="width:35%;">
-						<input type="text" class="form-control" id="usernameMapping" name="usernameMapping"  title="" value="${model.usernameMapping}"/>
+						<input type="text" class="form-control" id="usernameMapping" name="usernameMapping"  title="" value="${model.usernameMapping}"  required=""   />
 					</td>
 					<th style="width:15%;"><@locale code="apps.formbased.passwordMapping"/>:</th>
 					<td style="width:35%;">
-						<input type="text" class="form-control" id="passwordMapping" name="passwordMapping"  title="" value="${model.passwordMapping}"/>
+						<input type="text" class="form-control" id="passwordMapping" name="passwordMapping"  title="" value="${model.passwordMapping}"  required=""   />
 	
 					</td>
 				</tr>

+ 4 - 5
maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl

@@ -90,7 +90,6 @@ $(function(){
 								<td>id_token<input <#if   model.authorizedGrantTypes?contains('id_token') >checked</#if>  type="checkbox" id="grantTypes_id_token" name="authorizedGrantTypes" value="id_token"/></td>
 								<td>token<input <#if   model.authorizedGrantTypes?contains( 'token') >checked</#if>  type="checkbox" id="grantTypes_token" name="authorizedGrantTypes" value="token"/></td>
 								
-								<td><b class="orange">*</b><label for="authorizedGrantTypes"></label></td>
 							</tr>
 						</table>
 					</td>
@@ -98,20 +97,20 @@ $(function(){
 				<tr>
 					<th><@locale code="apps.oauth.registeredRedirectUris" />:</th>
 					<td colspan=3>
-						<textarea  class="form-control" id="registeredRedirectUris" name="registeredRedirectUris" rows="4" cols="60">${model.registeredRedirectUris}</textarea>
-						<b class="orange">*</b><label for="registeredRedirectUris"></label>
+						<textarea  class="form-control" id="registeredRedirectUris" name="registeredRedirectUris" rows="4" cols="60"  required="" >${model.registeredRedirectUris}</textarea>
+
 					</td>
 				</tr>
 				<tr>
 					<th><@locale code="apps.oauth.accessTokenValiditySeconds" />:</th>
 					<td >
 						<input type="text" class="form-control" id="accessTokenValiditySeconds" name="accessTokenValiditySeconds"  title="" value="${model.accessTokenValiditySeconds}"/>
-						<b class="orange">*</b><label for="accessTokenValiditySeconds"></label>
+			
 					</td>
 					<th><@locale code="apps.oauth.refreshTokenValiditySeconds" />:</th>
 					<td>
 						<input type="text" class="form-control" id="refreshTokenValiditySeconds" name="refreshTokenValiditySeconds"  title="" value="${model.refreshTokenValiditySeconds}"/>
-						<b class="orange">*</b><label for="refreshTokenValiditySeconds"></label>
+					
 					</td>
 				</tr>
 				<tr>

+ 10 - 18
maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl

@@ -38,35 +38,27 @@ $(function(){
 					<td colspan=4><@locale code="apps.saml.v2.0.info" /></td>
 				</tr>
 				<tr>
+                    <th><@locale code="apps.saml.spAcsUrl" />:</th>
+                    <td colspan =3>
+                        <input type="text" class="form-control"   id="spAcsUrl" name="spAcsUrl"  title="" value=""  required="" />
+                    </td>
+                </tr>
+				<tr>
 					<th><@locale code="apps.saml.entityId" />:</th>
 					<td colspan =3>
-						<input type="text" class="form-control"   id="entityId" name="entityId"  title="" value=""/>
-						<b class="orange">*</b><label for="entityId"></label>
+						<input type="text" class="form-control"   id="entityId" name="entityId"  title="" value=""  required="" />
 					</td>
-					
-					
 				</tr>
-				
 				<tr>
 					<th><@locale code="apps.saml.issuer" />:</th>
 					<td colspan =3>
-						<input type="text" class="form-control"   id="issuer" name="issuer"  title="" value=""/>
-						<b class="orange">*</b><label for="issuer"></label>
+						<input type="text" class="form-control"   id="issuer" name="issuer"  title="" value=""  required="" />
 					</td>
-					
 				</tr>
 				<tr>
-					<th><@locale code="apps.saml.spAcsUrl" />:</th>
-					<td colspan =3>
-						<input type="text" class="form-control"   id="spAcsUrl" name="spAcsUrl"  title="" value=""/>
-						<b class="orange">*</b><label for="spAcsUrl"></label>
-					</td>
-				</tr>
-				
-				<tr>
 					<th><@locale code="apps.saml.audience" />:</th>
 					<td colspan =3>
-						<input type="text" class="form-control"   id="audience" name="audience"  title="" value=""/>
+						<input type="text" class="form-control"   id="audience" name="audience"  title="" value="" required="" />
 					</td>
 				</tr>
 				<tr>
@@ -114,7 +106,7 @@ $(function(){
 					</td>
 					<th style="width:15%;"><@locale code="apps.saml.validityInterval" />:</th>
 					<td style="width:35%;">
-						<input type="text" class="form-control"   id="validityInterval" name="validityInterval"  title="" value="15"/>
+						<input type="text" class="form-control"   id="validityInterval" name="validityInterval"  title="" value="15"  required="" />
 					</td>
 					
 				</tr>

+ 12 - 14
maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl

@@ -51,29 +51,27 @@ $(function(){
 					<td colspan=4><@locale code="apps.saml.v2.0.info" /></td>
 				</tr>
 				<tr>
+                    <th><@locale code="apps.saml.spAcsUrl" />:</th>
+                    <td colspan =3>
+                        <input type="text" class="form-control"  id="spAcsUrl" name="spAcsUrl"  title="" value="${model.spAcsUrl!}"  required="" />
+                    </td>
+                </tr>
+				<tr>
 					<th><@locale code="apps.saml.entityId" />:</th>
 					<td  colspan =3>
-						<input type="text" class="form-control"  id="entityId" name="entityId"  title="" value="${model.entityId}"/>
-					</td>
-					
-					
-				</tr>
-				<tr>
-					<th><@locale code="apps.saml.spAcsUrl" />:</th>
-					<td colspan =3>
-						<input type="text" class="form-control"  id="spAcsUrl" name="spAcsUrl"  title="" value="${model.spAcsUrl}"/>
+						<input type="text" class="form-control"  id="entityId" name="entityId"  title="" value="${model.entityId!}"  required="" />
 					</td>
 				</tr>
 				<tr>
 					<th><@locale code="apps.saml.issuer" />:</th>
 					<td  colspan =3>
-						<input type="text" class="form-control"  id="issuer" name="issuer"  title="" value="${model.issuer}"/>
+						<input type="text" class="form-control"  id="issuer" name="issuer"  title="" value="${model.issuer!}"  required="" />
 					</td>
 				</tr>
 				<tr>
 					<th><@locale code="apps.saml.audience" />:</th>
 					<td  colspan =2>
-						<input type="text" class="form-control"  id="audience" name="audience"  title="" value="${model.audience}"/>
+						<input type="text" class="form-control"  id="audience" name="audience"  title="" value="${model.audience!}"  required="" />
 					</td>
 					<td  >
 						<a target="_blank" href="${maxKeyURI}/metadata/saml20/${model.id}.xml"> SAML MetaData</a>
@@ -165,15 +163,15 @@ $(function(){
 				</tr>
 				<tr>
 					<th><@locale code="apps.saml.certIssuer" />:</th>
-					<td>${model.certIssuer}
+					<td>${model.certIssuer!}
 					</td>
 					<th><@locale code="apps.saml.certExpiration" />:</th>
-					<td>${model.certExpiration}
+					<td>${model.certExpiration!}
 					</td>
 				</tr>
 				<tr>
 					<th><@locale code="apps.saml.certSubject" />:</th>
-					<td  colspan =3>${model.certSubject}
+					<td  colspan =3>${model.certSubject!}
 					</td>
 				</tr>
 				<tr>

+ 3 - 5
maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl

@@ -53,8 +53,7 @@ $(function(){
 							<tr>
 								<th style="width:15%;"><@locale code="apps.tokenbased.redirectUri" />:</th>
 								<td style="width:35%;" colspan=3>
-									<input type="text" class="form-control" id="redirectUri" name="redirectUri"  title="" value=""/>
-									<b class="orange">*</b><label for="redirectUri"></label>
+									<input type="text" class="form-control" id="redirectUri" name="redirectUri"  title="" value=""  required="" />
 								</td>
 							</tr>
 							<tr>
@@ -68,7 +67,6 @@ $(function(){
 									<th ><@locale code="apps.tokenbased.cookieName" />:</th>
 									<td >
 										<input type="text" class="form-control" id="cookieName" name="cookieName"  title="" value=""/>
-										<b class="orange">*</b><label for="cookieName"></label>
 									</td>
 								</tr>
 							<tr>
@@ -97,7 +95,7 @@ $(function(){
 									<table class="hidetable" style="width:100%;">
 										<tr>
 											<td><@locale code="userinfo.id" /><input type="checkbox" id="uid" name="uid" value="1"/></td>
-											<td><@locale code="userinfo.username" /><input type="checkbox" id="username" name="username" value="1"/></td>
+											<td><@locale code="userinfo.username" /><input type="checkbox" id="username" name="username" value="1" checked/></td>
 											<td><@locale code="userinfo.email" /><input type="checkbox" id="email" name="email" value="1"/></td>
 											<td><@locale code="userinfo.windowsAccount" /><input type="checkbox" id="windowsAccount" name="windowsAccount" value="1"/></td>
 											<td><@locale code="userinfo.employeeNumber" /><input type="checkbox" id="employeeNumber" name="employeeNumber" value="1"/></td>
@@ -110,7 +108,7 @@ $(function(){
 							<tr>
 								<th><@locale code="apps.tokenbased.expires" />:</th>
 								<td>
-									<input type="text" class="form-control" id="expires" name="expires"  title="" value="1"/>
+									<input type="text" class="form-control" id="expires" name="expires"  title="" value="1"  required="" />
 								</td>
 								<th><@locale code="apps.isAdapter" />:</th>
 								<td >

+ 2 - 2
maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl

@@ -61,7 +61,7 @@ $(function(){
 								<tr>
 									<th style="width:15%;"><@locale code="apps.tokenbased.redirectUri" />:</th>
 									<td  colspan=3>
-										<input type="text" id="redirectUri" class="form-control" name="redirectUri"  title="" value="${model.redirectUri}"/>
+										<input type="text" id="redirectUri" class="form-control" name="redirectUri"  title="" value="${model.redirectUri}"  required="" />
 									</td>
 								</tr>
 								<tr>
@@ -117,7 +117,7 @@ $(function(){
 								<tr>
 									<th><@locale code="apps.tokenbased.expires" />:</th>
 									<td>
-										<input type="text" class="form-control" id="expires" name="expires"  title="" value="${model.expires}"/>
+										<input type="text" class="form-control" id="expires" name="expires"  title="" value="${model.expires}"  required="" />
 									</td>
 									<th><@locale code="apps.isAdapter" />:</th>
 									<td>

+ 1 - 1
maxkey-web-manage/src/main/resources/templates/views/groups/groupAdd.ftl

@@ -17,7 +17,7 @@
 			<tr>
 				<th><@locale code="group.name" />:</th>
 				<td nowrap>
-					<input type="text" id="name" name="name" class="form-control" title="" value=""/>
+					<input type="text" id="name" name="name" class="form-control" title="" value=""  required="" />
 				</td>
 			</tr>
 			<tr>

+ 1 - 1
maxkey-web-manage/src/main/resources/templates/views/groups/groupUpdate.ftl

@@ -23,7 +23,7 @@
 		<tr>
 			<th><@locale code="group.name" />:</th>
 			<td nowrap>
-				<input type="text" id="name" name="name" class="form-control" title="" value="${model.name}"/>
+				<input type="text" id="name" name="name" class="form-control" title="" value="${model.name}"  required="" />
 			</td>
 		</tr>
 		<tr>

+ 1 - 0
maxkey-web-maxkey/.classpath

@@ -16,6 +16,7 @@
 		<attributes>
 			<attribute name="gradle_scope" value="test"/>
 			<attribute name="gradle_used_by_scope" value="test"/>
+			<attribute name="test" value="true"/>
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>

+ 10 - 10
maxkey-web-maxkey/.project

@@ -3,20 +3,20 @@
 	<name>maxkey-web-maxkey</name>
 	<comment>maxkey-web-maxkey</comment>
 	<projects>
-		<project>maxkey-protocol-desktop</project>
-		<project>maxkey-protocol-tokenbased</project>
-		<project>maxkey-client-sdk</project>
 		<project>maxkey-jose-jwt</project>
-		<project>maxkey-protocol-authorize</project>
-		<project>maxkey-protocol-saml-2.0</project>
-		<project>maxkey-protocol-oauth-2.0</project>
-		<project>maxkey-authentications</project>
-		<project>maxkey-protocol-formbased</project>
 		<project>maxkey-protocol-simulate</project>
-		<project>maxkey-dao</project>
+		<project>maxkey-protocol-oauth-2.0</project>
+		<project>maxkey-protocol-saml-2.0</project>
 		<project>maxkey-core</project>
-		<project>maxkey-protocol-extendapi</project>
+		<project>maxkey-dao</project>
+		<project>maxkey-client-sdk</project>
+		<project>maxkey-authentications</project>
+		<project>maxkey-protocol-authorize</project>
 		<project>maxkey-protocol-cas</project>
+		<project>maxkey-protocol-desktop</project>
+		<project>maxkey-protocol-extendapi</project>
+		<project>maxkey-protocol-formbased</project>
+		<project>maxkey-protocol-tokenbased</project>
 	</projects>
 	<buildSpec>
 		<buildCommand>

+ 2 - 2
maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl

@@ -40,13 +40,13 @@
 			<tr>
 				<th><@locale code="login.password.newPassword" />:</th>
 				<td>
-					<input type="password" id="newPassword" name="newPassword" class="form-control" title="" value=""/>
+					<input type="password" id="newPassword" name="newPassword" class="form-control" title="" value=""  required="" />
 				</td>
 			</tr>
 			<tr>
 				<th><@locale code="login.password.confirmPassword" />:</th>
 				<td nowrap>
-					<input type="password" id="confirmPassword" name="confirmPassword" class="form-control" title="" value=""/>
+					<input type="password" id="confirmPassword" name="confirmPassword" class="form-control" title="" value=""  required="" />
 				</td>
 			</tr>
 			<tr>

+ 2 - 2
maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl

@@ -40,13 +40,13 @@
 			<tr>
 				<th><@locale code="login.password.newPassword" />:</th>
 				<td>
-					<input type="password" id="newPassword" name="newPassword" class="form-control" title="" value=""/>
+					<input type="password" id="newPassword" name="newPassword" class="form-control" title="" value=""  required="" />
 				</td>
 			</tr>
 			<tr>
 				<th><@locale code="login.password.confirmPassword" />:</th>
 				<td nowrap>
-					<input type="password" id="confirmPassword" name="confirmPassword" class="form-control" title="" value=""/>
+					<input type="password" id="confirmPassword" name="confirmPassword" class="form-control" title="" value=""  required="" />
 				</td>
 			</tr>
 			<tr>

+ 1 - 1
maxkey-web-maxkey/src/main/resources/templates/views/profile/myProfile.ftl

@@ -50,7 +50,7 @@
 				<tr>
 					<th><@locale code="userinfo.displayName" />:</th>
 					<td>
-						<input class="form-control"  type="text" id="displayName" name="displayName"  title="" value="${model.displayName!}"/>
+						<input class="form-control"  type="text" id="displayName" name="displayName"  title="" value="${model.displayName!}"  required="" />
 						<label for="displayName"></label>
 					</td>
 					<th rowspan="4"><@locale code="userinfo.picture" />:</th>

+ 3 - 3
maxkey-web-maxkey/src/main/resources/templates/views/safe/changePassword.ftl

@@ -36,20 +36,20 @@
 			<tr>
 				<th><@locale code="login.password.oldPassword" /> :</th>
 				<td>
-					<input  class="form-control"  type="password" id="oldPassword" name="oldPassword" class="required" title="" value=""/>
+					<input  class="form-control"  type="password" id="oldPassword" name="oldPassword" class="required" title="" value=""  required="" />
 				</td>
 			</tr>
 			<tr>
 				<th><@locale code="login.password.newPassword" />:</th>
 				<td>
-					<input  class="form-control"  type="password" id="newPassword" name="newPassword" class=" required" title="" value=""/>
+					<input  class="form-control"  type="password" id="newPassword" name="newPassword" class=" required" title="" value=""  required="" />
 
 				</td>
 			</tr>
 			<tr>
 				<th><@locale code="login.password.confirmPassword" />:</th>
 				<td nowrap>
-					<input  class="form-control"  type="password" id="confirmPassword" name="confirmPassword" class="{ required: true, equalTo: '#newPassword' }" title="" value=""/>
+					<input  class="form-control"  type="password" id="confirmPassword" name="confirmPassword" class="{ required: true, equalTo: '#newPassword' }" title="" value=""  required="" />
 				</td>
 			</tr>
 			<tr>

+ 2 - 2
maxkey-web-maxkey/src/main/resources/templates/views/safe/setting.ftl

@@ -59,7 +59,7 @@
 			<tr>
 				<th><@locale code="userinfo.mobile" /> :</th>
 				<td>
-					<input   class="form-control" type="text" id="mobile" name="mobile" class=" required" title="" value="${model.mobile}"/>
+					<input   class="form-control" type="text" id="mobile" name="mobile" class=" required" title="" value="${model.mobile}"  required="" />
 					<label for="mobile"></label>
 				</td>
 			</tr>
@@ -73,7 +73,7 @@
 			<tr>
 				<th><@locale code="userinfo.email" /> :</th>
 				<td>
-					<input  class="form-control"  type="text" id="email" name="email" class="required" title="" value="${model.email}"/>
+					<input  class="form-control"  type="text" id="email" name="email" class="required" title="" value="${model.email}"  required="" />
 					<label for="eamil"></label>
 				</td>
 			</tr>