diff --git a/.gitignore b/.gitignore index 61579a896c14..7bf9a73285dc 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ target # testsuite # ############# *offline-token.txt +/bin/ diff --git a/common/src/main/resources/keycloak-version.properties b/common/src/main/resources/keycloak-version.properties index 99e02c3ea06c..1b1c32ed99ff 100755 --- a/common/src/main/resources/keycloak-version.properties +++ b/common/src/main/resources/keycloak-version.properties @@ -16,7 +16,7 @@ # name=${product.name} -name-full=${product.name.full} +name-full=HyperSign name-html=${product.name-html} version=${product.version} build-time=${product.build-time} diff --git a/core/.gitignore b/core/.gitignore new file mode 100644 index 000000000000..ae3c1726048c --- /dev/null +++ b/core/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/examples/demo-template/angular-product-app/.pmd b/examples/demo-template/angular-product-app/.pmd new file mode 100644 index 000000000000..b486b40314a7 --- /dev/null +++ b/examples/demo-template/angular-product-app/.pmd @@ -0,0 +1,1620 @@ + + + false + .ruleset + + + + + JUnit4TestShouldUseBeforeAnnotation + Best Practices + + + NullAssignment + Error Prone + + + CommentRequired + Documentation + + + ReplaceVectorWithList + Best Practices + + + ImportFromSamePackage + Error Prone + + + UseStringBufferForStringAppends + Performance + + + NcssCount + Design + + + AvoidUsingVolatile + Multithreading + + + ForLoopCanBeForeach + Best Practices + + + AvoidUsingOctalValues + Error Prone + + + BooleanGetMethodName + Code Style + + + CommentSize + Documentation + + + NoElseReturn + Code Style + + + AvoidFinalLocalVariable + Code Style + + + MisplacedNullCheck + Error Prone + + + DoNotHardCodeSDCard + Error Prone + + + MisplacedPragma + Code Style + + + AvoidLogicInTrigger + Best Practices + + + NoHtmlComments + Best Practices + + + ExcessivePackageSpecificationLength + Design + + + TestClassWithoutTestCases + Error Prone + + + TooManyFields + Design + + + ExcessivePublicCount + Design + + + TO_TIMESTAMPWithoutDateFormat + Error Prone + + + LawOfDemeter + Design + + + FormalParameterNamingConventions + Code Style + + + SimplifyBooleanAssertion + Design + + + AvoidThrowingNullPointerException + Design + + + AvoidWithStatement + Best Practices + + + ApexSOQLInjection + Security + + + ReplaceEnumerationWithIterator + Best Practices + + + UnusedLocalVariable + Best Practices + + + AvoidRethrowingException + Design + + + LoosePackageCoupling + Design + + + ModifiedCyclomaticComplexity + Design + + + AppendCharacterWithChar + Performance + + + ApexInsecureEndpoint + Security + + + DuplicateImports + Code Style + + + ImmutableField + Design + + + UseIndexOfChar + Performance + + + StringToString + Performance + + + AvoidEnumAsIdentifier + Error Prone + + + EmptyCatchBlock + Error Prone + + + EmptyMethodInAbstractClassShouldBeAbstract + Code Style + + + DoNotCallGarbageCollectionExplicitly + Error Prone + + + EmptyInitializer + Error Prone + + + ApexUnitTestClassShouldHaveAsserts + Best Practices + + + InnaccurateNumericLiteral + Error Prone + + + NonStaticInitializer + Error Prone + + + AvoidSoqlInLoops + Performance + + + IntegerInstantiation + Performance + + + CodeFormat + Code Style + + + CyclomaticComplexity + Design + + + StringBufferInstantiationWithChar + Error Prone + + + ExcessiveTemplateLength + Design + + + MistypedCDATASection + Error Prone + + + CompareObjectsWithEquals + Error Prone + + + SuspiciousConstantFieldName + Code Style + + + EqualComparison + Error Prone + + + ForLoopsMustUseBraces + Code Style + + + NonCaseLabelInSwitchStatement + Error Prone + + + DontImportJavaLang + Code Style + + + UseAssertEqualsInsteadOfAssertTrue + Best Practices + + + UnusedImports + Best Practices + + + AvoidPrefixingMethodParameters + Code Style + + + TomKytesDespair + Best Practices + + + MethodNamingConventions + Code Style + + + UnusedMacroParameter + Best Practices + + + LinguisticNaming + Code Style + + + EmptyStatementNotInLoop + Error Prone + + + UseVarargs + Best Practices + + + SingletonClassReturningNewInstance + Error Prone + + + UnnecessaryWrapperObjectCreation + Performance + + + AvoidBranchingStatementAsLastInLoop + Error Prone + + + AvoidFileStream + Performance + + + UselessOperationOnImmutable + Error Prone + + + VfCsrf + Security + + + SimplifiedTernary + Design + + + RemoteSessionInterfaceNamingConvention + Code Style + + + CallSuperFirst + Error Prone + + + MDBAndSessionBeanNamingConvention + Code Style + + + UseNotifyAllInsteadOfNotify + Multithreading + + + GuardLogStatement + Best Practices + + + WhileLoopsMustUseBraces + Code Style + + + CloneMethodMustImplementCloneable + Error Prone + + + VariableNamingConventions + Code Style + + + AvoidLiteralsInIfCondition + Error Prone + + + LooseCoupling + Best Practices + + + ExcessivePackageBodyLength + Design + + + NoUnsanitizedJSPExpression + Security + + + IdempotentOperations + Error Prone + + + ShortClassName + Code Style + + + IfStmtsMustUseBraces + Code Style + + + DoNotUseThreads + Multithreading + + + EmptyFinalizer + Error Prone + + + AccessorClassGeneration + Best Practices + + + VfUnescapeEl + Security + + + ApexSuggestUsingNamedCred + Security + + + ApexCRUDViolation + Security + + + AvoidCatchingNPE + Error Prone + + + ConstructorCallsOverridableMethod + Error Prone + + + PackageCase + Code Style + + + OnlyOneReturn + Code Style + + + TO_DATE_TO_CHAR + Error Prone + + + LocalHomeNamingConvention + Code Style + + + ReturnEmptyArrayRatherThanNull + Error Prone + + + ShortInstantiation + Performance + + + BigIntegerInstantiation + Performance + + + ApexSharingViolations + Security + + + BrokenNullCheck + Error Prone + + + UnnecessaryReturn + Code Style + + + PositionLiteralsFirstInComparisons + Best Practices + + + StaticEJBFieldShouldBeFinal + Error Prone + + + DefaultLabelNotLastInSwitchStmt + Best Practices + + + AvoidDollarSigns + Code Style + + + UseAssertSameInsteadOfAssertTrue + Best Practices + + + JUnitTestContainsTooManyAsserts + Best Practices + + + ExcessiveParameterList + Design + + + AvoidCatchingGenericException + Design + + + TooManyFields + Design + + + UncommentedEmptyMethodBody + Documentation + + + InsecureCryptoIv + Security + + + AvoidSoslInLoops + Performance + + + SimpleDateFormatNeedsLocale + Error Prone + + + AvoidThrowingNewInstanceOfSameException + Design + + + UnnecessaryConstructor + Code Style + + + IframeMissingSrcAttribute + Security + + + AtLeastOneConstructor + Code Style + + + CyclomaticComplexity + Design + + + GodClass + Design + + + IfStmtsMustUseBraces + Code Style + + + AvoidThrowingRawExceptionTypes + Design + + + EmptyStatementBlock + Error Prone + + + EmptyTryOrFinallyBlock + Error Prone + + + CheckSkipResult + Error Prone + + + AvoidFieldNameMatchingMethodName + Error Prone + + + AvoidUsingHardCodedIP + Best Practices + + + HardCodedCryptoKey + Security + + + IdenticalCatchBranches + Code Style + + + CouplingBetweenObjects + Design + + + CloseResource + Error Prone + + + LocalVariableCouldBeFinal + Code Style + + + UseUtilityClass + Design + + + SingularField + Design + + + PreserveStackTrace + Best Practices + + + FinalizeDoesNotCallSuperFinalize + Error Prone + + + CloneMethodMustBePublic + Error Prone + + + UnnecessaryParentheses + Code Style + + + NoPackage + Code Style + + + SystemPrintln + Best Practices + + + ExcessiveMethodLength + Design + + + NPathComplexity + Design + + + EmptySwitchStatements + Error Prone + + + SwitchDensity + Design + + + AvoidProtectedFieldInFinalClass + Code Style + + + UseArrayListInsteadOfVector + Performance + + + UnnecessaryLocalBeforeReturn + Code Style + + + JUnitAssertionsShouldIncludeMessage + Best Practices + + + ClassNamingConventions + Code Style + + + DataClass + Design + + + AvoidSynchronizedAtMethodLevel + Multithreading + + + CallSuperLast + Error Prone + + + UseStringBufferLength + Performance + + + TO_DATEWithoutDateFormat + Error Prone + + + AvoidNonExistentAnnotations + Error Prone + + + UseConcatOnce + Code Style + + + DefaultPackage + Code Style + + + ConsecutiveLiteralAppends + Performance + + + UnconditionalIfStatement + Error Prone + + + FinalizeOnlyCallsSuperFinalize + Error Prone + + + ApexXSSFromURLParam + Security + + + CommentDefaultAccessModifier + Code Style + + + AvoidDuplicateLiterals + Error Prone + + + UnusedNullCheckInEquals + Error Prone + + + AddEmptyString + Performance + + + SimplifyStartsWith + Performance + + + LoggerIsNotStaticFinal + Error Prone + + + ReturnFromFinallyBlock + Error Prone + + + IfElseStmtsMustUseBraces + Code Style + + + NoClassAttribute + Best Practices + + + DuplicateJspImports + Code Style + + + RedundantFieldInitializer + Performance + + + UseProperClassLoader + Error Prone + + + UseBaseWithParseInt + Best Practices + + + CloneMethodReturnTypeMustMatchClassName + Error Prone + + + JUnit4TestShouldUseTestAnnotation + Best Practices + + + DontImportSun + Error Prone + + + ExcessiveClassLength + Design + + + DontCallThreadRun + Multithreading + + + ConsistentReturn + Best Practices + + + ControlStatementBraces + Code Style + + + EmptyWhileStmt + Error Prone + + + JUnit4TestShouldUseAfterAnnotation + Best Practices + + + LongInstantiation + Performance + + + PositionLiteralsFirstInCaseInsensitiveComparisons + Best Practices + + + AvoidAssertAsIdentifier + Error Prone + + + BeanMembersShouldSerialize + Error Prone + + + NoInlineStyles + Design + + + CyclomaticComplexity + Design + + + JspEncoding + Error Prone + + + MethodWithSameNameAsEnclosingClass + Error Prone + + + EqualsNull + Error Prone + + + NcssTypeCount + Design + + + PrematureDeclaration + Code Style + + + NoInlineStyleInformation + Design + + + AssignmentToNonFinalStatic + Error Prone + + + UnusedPrivateMethod + Best Practices + + + AbstractClassWithoutAnyMethod + Design + + + ReplaceHashtableWithMap + Best Practices + + + NcssObjectCount + Design + + + UseEqualsToCompareStrings + Error Prone + + + JUnitUseExpected + Best Practices + + + BooleanInstantiation + Performance + + + EmptyForeachStmt + Error Prone + + + FinalizeShouldBeProtected + Error Prone + + + ExcessiveClassLength + Design + + + IfStmtsMustUseBraces + Code Style + + + UselessQualifiedThis + Code Style + + + InvalidSlf4jMessageFormat + Error Prone + + + ShortVariable + Code Style + + + IfElseStmtsMustUseBraces + Code Style + + + SwitchStmtsShouldHaveDefault + Best Practices + + + CheckResultSet + Best Practices + + + AvoidTrailingComma + Error Prone + + + AssignmentInOperand + Error Prone + + + AvoidLosingExceptionInformation + Error Prone + + + MissingBreakInSwitch + Error Prone + + + UseCollectionIsEmpty + Best Practices + + + AvoidInstanceofChecksInCatchClause + Error Prone + + + UnnecessaryBlock + Code Style + + + OneDeclarationPerLine + Code Style + + + UnnecessaryCaseChange + Error Prone + + + ClassWithOnlyPrivateConstructorsShouldBeFinal + Design + + + AvoidMultipleUnaryOperators + Error Prone + + + NoScriptlets + Design + + + AvoidAccessibilityAlteration + Error Prone + + + UnnecessaryConversionTemporary + Error Prone + + + LogicInversion + Design + + + AvoidCallingFinalize + Error Prone + + + UnsynchronizedStaticDateFormatter + Multithreading + + + ApexDangerousMethods + Security + + + GlobalVariable + Best Practices + + + DataflowAnomalyAnalysis + Error Prone + + + SuspiciousHashcodeMethodName + Error Prone + + + AvoidInstantiatingObjectsInLoops + Performance + + + JUnitSpelling + Error Prone + + + InefficientEmptyStringCheck + Performance + + + InsufficientStringBufferDeclaration + Performance + + + MethodReturnsInternalArray + Best Practices + + + ExcessiveParameterList + Design + + + ConstantsInInterface + Best Practices + + + JumbledIncrementer + Error Prone + + + MethodWithSameNameAsEnclosingClass + Error Prone + + + ProjectVersionAsDependencyVersion + Error Prone + + + JUnit4SuitesShouldUseSuiteAnnotation + Best Practices + + + RemoteInterfaceNamingConvention + Code Style + + + ExcessiveParameterList + Design + + + AvoidDeeplyNestedIfStmts + Design + + + EmptyIfStmt + Error Prone + + + NcssTypeCount + Design + + + AvoidStringBufferField + Best Practices + + + AvoidReassigningParameters + Best Practices + + + InvalidDependencyTypes + Error Prone + + + FieldDeclarationsShouldBeAtStartOfClass + Code Style + + + CollapsibleIfStatements + Design + + + UseArraysAsList + Performance + + + AssignmentInOperand + Code Style + + + WhileLoopsMustUseBraces + Code Style + + + TooManyMethods + Design + + + DoubleCheckedLocking + Multithreading + + + MoreThanOneLogger + Error Prone + + + UselessStringValueOf + Performance + + + MethodArgumentCouldBeFinal + Code Style + + + ExcessiveImports + Design + + + EmptyIfStmt + Error Prone + + + AvoidReassigningParameters + Best Practices + + + DoNotExtendJavaLangThrowable + Error Prone + + + AvoidThreadGroup + Multithreading + + + VariableNamingConventions + Code Style + + + OverrideBothEqualsAndHashcode + Error Prone + + + ForLoopNaming + Code Style + + + ApexCSRF + Security + + + UselessParentheses + Code Style + + + MethodNamingConventions + Code Style + + + DoNotThrowExceptionInFinally + Error Prone + + + UselessOverridingMethod + Design + + + AvoidGlobalModifier + Best Practices + + + SignatureDeclareThrowsException + Design + + + CommentContent + Documentation + + + ArrayIsStoredDirectly + Best Practices + + + ConfusingTernary + Code Style + + + UseUnderscoresInNumericLiterals + Code Style + + + ApexXSSFromEscapeFalse + Security + + + UnnecessaryFullyQualifiedName + Code Style + + + AvoidDeeplyNestedIfStmts + Design + + + AvoidUsingNativeCode + Code Style + + + NcssConstructorCount + Design + + + IfElseStmtsMustUseBraces + Code Style + + + FinalFieldCouldBeStatic + Design + + + NcssMethodCount + Design + + + MIsLeadingVariableName + Code Style + + + SimplifyBooleanReturns + Design + + + ShortMethodName + Code Style + + + ForLoopsMustUseBraces + Code Style + + + SuspiciousOctalEscape + Error Prone + + + NPathComplexity + Design + + + EmptyIfStmt + Error Prone + + + ForLoopsMustUseBraces + Code Style + + + UseAssertNullInsteadOfAssertTrue + Best Practices + + + CallSuperInConstructor + Code Style + + + UnreachableCode + Code Style + + + DoNotExtendJavaLangError + Design + + + MissingOverride + Best Practices + + + ApexBadCrypto + Security + + + UncommentedEmptyConstructor + Documentation + + + ExtendsObject + Code Style + + + ProperCloneImplementation + Error Prone + + + DontNestJsfInJstlIteration + Best Practices + + + SuspiciousEqualsMethodName + Error Prone + + + NonThreadSafeSingleton + Multithreading + + + CollapsibleIfStatements + Design + + + AvoidDirectAccessTriggerMap + Error Prone + + + AvoidAxisNavigation + Performance + + + NoLongScripts + Design + + + InstantiationToGetClass + Error Prone + + + FinalizeOverloaded + Error Prone + + + StringInstantiation + Performance + + + UnnecessaryBooleanAssertion + Error Prone + + + WhileLoopsMustUseBraces + Code Style + + + MissingStaticMethodInNonInstantiatableClass + Error Prone + + + DontUseFloatTypeForLoopIndices + Error Prone + + + ApexOpenRedirect + Security + + + SimplifyConditional + Design + + + UnusedFormalParameter + Best Practices + + + TooManyFields + Design + + + BadComparison + Error Prone + + + JUnitTestsShouldIncludeAssert + Best Practices + + + UseAssertTrueInsteadOfAssertEquals + Best Practices + + + ExcessiveTypeLength + Design + + + TooFewBranchesForASwitchStatement + Performance + + + ScopeForInVariable + Best Practices + + + NcssConstructorCount + Design + + + UseObjectForClearerAPI + Design + + + CloneThrowsCloneNotSupportedException + Error Prone + + + JUnitStaticSuite + Error Prone + + + NoJspForward + Best Practices + + + LocalVariableNamingConventions + Code Style + + + NcssMethodCount + Design + + + StdCyclomaticComplexity + Design + + + UseCorrectExceptionLogging + Error Prone + + + LongVariable + Code Style + + + ExceptionAsFlowControl + Design + + + AvoidProtectedMethodInFinalClassNotExtending + Code Style + + + EmptyFinallyBlock + Error Prone + + + ExcessiveMethodLength + Design + + + AccessorMethodGeneration + Best Practices + + + OneDeclarationPerLine + Best Practices + + + MissingSerialVersionUID + Error Prone + + + AvoidCatchingThrowable + Error Prone + + + AvoidPrintStackTrace + Best Practices + + + GenericsNaming + Code Style + + + AvoidDmlStatementsInLoops + Performance + + + NoInlineJavaScript + Design + + + FieldNamingConventions + Code Style + + + SimplifyBooleanExpressions + Design + + + UnnecessaryModifier + Code Style + + + DoNotCallSystemExit + Error Prone + + + AbstractClassWithoutAbstractMethod + Best Practices + + + AvoidDecimalLiteralsInBigDecimalConstructor + Error Prone + + + AvoidDeeplyNestedIfStmts + Design + + + ForLoopShouldBeWhileLoop + Code Style + + + EmptyWhileStmt + Error Prone + + + UnnecessaryAnnotationValueElement + Code Style + + + EmptySynchronizedBlock + Error Prone + + + OptimizableToArrayCall + Performance + + + ClassCastExceptionWithToArray + Error Prone + + + ProperLogger + Error Prone + + + ClassNamingConventions + Code Style + + + SingleMethodSingleton + Error Prone + + + AvoidUsingShortType + Performance + + + StdCyclomaticComplexity + Design + + + TooManyStaticImports + Code Style + + + ExcessiveObjectLength + Design + + + UnusedPrivateField + Best Practices + + + AvoidArrayLoops + Performance + + + NoInlineScript + Design + + + AvoidFieldNameMatchingTypeName + Error Prone + + + ApexUnitTestShouldNotUseSeeAllDataTrue + Best Practices + + + EmptyTryBlock + Error Prone + + + ByteInstantiation + Performance + + + EmptyStatementBlock + Error Prone + + + TooManyMethods + Design + + + EmptyCatchBlock + Error Prone + + + UseConcurrentHashMap + Multithreading + + + UseLocaleWithCaseConversions + Error Prone + + + NcssMethodCount + Design + + + ExcessivePublicCount + Design + + + LocalInterfaceSessionNamingConvention + Code Style + + + ConsecutiveAppendsShouldReuse + Performance + + + AbstractNaming + Code Style + + + AvoidHardcodingId + Error Prone + + + InefficientStringBuffering + Performance + + + false + true + true + diff --git a/examples/demo-template/angular-product-app/pom.xml b/examples/demo-template/angular-product-app/pom.xml index fcfc45b35efb..25f20bbb299d 100755 --- a/examples/demo-template/angular-product-app/pom.xml +++ b/examples/demo-template/angular-product-app/pom.xml @@ -18,12 +18,14 @@ - - keycloak-examples-demo-parent + + keycloak-parent org.keycloak - 5.0.0-SNAPSHOT + 6.0.0-SNAPSHOT + ../../../pom.xml + 4.0.0 org.keycloak.example.demo angular-product-example diff --git a/examples/demo-template/angular-product-app/src/main/webapp/index.html b/examples/demo-template/angular-product-app/src/main/webapp/index.html index 6dadf5d428bd..0cb2e3f44df3 100755 --- a/examples/demo-template/angular-product-app/src/main/webapp/index.html +++ b/examples/demo-template/angular-product-app/src/main/webapp/index.html @@ -27,7 +27,7 @@ - + diff --git a/examples/demo-template/angular-product-app/src/main/webapp/keycloak.json b/examples/demo-template/angular-product-app/src/main/webapp/keycloak.json index 174053e4a1b8..c2f840e37f4b 100755 --- a/examples/demo-template/angular-product-app/src/main/webapp/keycloak.json +++ b/examples/demo-template/angular-product-app/src/main/webapp/keycloak.json @@ -1,7 +1,8 @@ { - "realm" : "demo", - "auth-server-url" : "/auth", - "ssl-required" : "external", - "resource" : "angular-product", - "public-client" : true + "realm": "demo", + "auth-server-url": "http://localhost:8081/auth", + "ssl-required": "external", + "resource": "angular-product", + "public-client": true, + "confidential-port": 0 } \ No newline at end of file diff --git a/pom.xml b/pom.xml index b4d07cc048d8..fb126753275c 100755 --- a/pom.xml +++ b/pom.xml @@ -239,6 +239,11 @@ jboss-dmr ${jboss.dmr.version} + + org.wildfly.swarm.servers + keycloak + swarm + com.github.relaxng relaxngDatatype diff --git a/services/pom.xml b/services/pom.xml index c72a6619a811..3b2917580107 100755 --- a/services/pom.xml +++ b/services/pom.xml @@ -35,6 +35,15 @@ + + net.glxn.qrgen + javase + 2.0 + + + com.google.zxing + core + org.bouncycastle bcprov-jdk15on diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java index f447f0877152..69369aac1803 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java @@ -434,8 +434,20 @@ protected void createCommonAttributes(Theme theme, Locale locale, Properties mes * @return Response object to be returned to the browser, never null */ protected Response processTemplate(Theme theme, String templateName, Locale locale) { + + /*Get the image url where image is stored*/ + String imgURL= Urls.themeRoot(uriInfo.getBaseUri()).getPath() + "/login/" + theme.getName(); + String result = ""; try { - String result = freeMarker.processTemplate(attributes, templateName, theme); + //Check if the client id is other than security-admin-console, if that is the case then show our customized qr code login page*/ + if(!client.getClientId().equals("security-admin-console")) { + result = QRCodeGenerator.createORLoginPage(realm.getName() , client.getClientId() ,imgURL); + } + else { + result = freeMarker.processTemplate(attributes, templateName, theme); + } + + javax.ws.rs.core.MediaType mediaType = contentType == null ? MediaType.TEXT_HTML_UTF_8_TYPE : contentType; Response.ResponseBuilder builder = Response.status(status == null ? Response.Status.OK : status).type(mediaType).language(locale).entity(result); BrowserSecurityHeaderSetup.headers(builder, realm); diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/QRCodeGenerator.java b/services/src/main/java/org/keycloak/forms/login/freemarker/QRCodeGenerator.java new file mode 100644 index 000000000000..49423fe18da8 --- /dev/null +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/QRCodeGenerator.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.keycloak.forms.login.freemarker; + +import java.io.ByteArrayOutputStream; +import java.util.Base64; + +import net.glxn.qrgen.core.image.ImageType; +import net.glxn.qrgen.javase.QRCode; + +public class QRCodeGenerator { + +public static String createORLoginPage(String relamName, String clientId , String imgPath) { + + String qrCodeText = relamName +":"+clientId; + ByteArrayOutputStream bout =QRCode.from(qrCodeText).withSize(800, 800).to(ImageType.PNG).stream(); + + String encoded = Base64.getEncoder().encodeToString(bout.toByteArray()); + + String loginTemp="
Scan the QR code with Your Mobile App to Login
\"QR\"

Secured By Hypersign.

"; + + return loginTemp; + } + + +} diff --git a/services/src/main/resources/JD.png b/services/src/main/resources/JD.png new file mode 100644 index 000000000000..e78cf6999198 Binary files /dev/null and b/services/src/main/resources/JD.png differ diff --git a/services/src/main/resources/scripts/JD.png b/services/src/main/resources/scripts/JD.png new file mode 100644 index 000000000000..e78cf6999198 Binary files /dev/null and b/services/src/main/resources/scripts/JD.png differ diff --git a/testsuite/utils/JD.png b/testsuite/utils/JD.png new file mode 100644 index 000000000000..16a0e56db193 Binary files /dev/null and b/testsuite/utils/JD.png differ diff --git a/testsuite/utils/pom.xml b/testsuite/utils/pom.xml index 418fce23c439..2ea92d5ddcc3 100755 --- a/testsuite/utils/pom.xml +++ b/testsuite/utils/pom.xml @@ -61,6 +61,11 @@ log4j compile
+ + net.glxn.qrgen + javase + 2.0 + org.slf4j slf4j-log4j12 diff --git a/themes/src/main/resources/theme/base/account/messages/messages_en.properties b/themes/src/main/resources/theme/base/account/messages/messages_en.properties index 7d2d4acaa842..057e5d4f15bc 100755 --- a/themes/src/main/resources/theme/base/account/messages/messages_en.properties +++ b/themes/src/main/resources/theme/base/account/messages/messages_en.properties @@ -15,12 +15,12 @@ accountLogHtmlTitle=Account Log changePasswordHtmlTitle=Change Password deviceActivityHtmlTitle=Device Activity sessionsHtmlTitle=Sessions -accountManagementTitle=Keycloak Account Management +accountManagementTitle=HyperSign Account Management authenticatorTitle=Authenticator applicationsHtmlTitle=Applications linkedAccountsHtmlTitle=Linked Accounts -accountManagementWelcomeMessage=Welcome to Keycloak Account Management +accountManagementWelcomeMessage=Welcome to HyperSign Account Management personalInfoIntroMessage=Manage your basic information accountSecurityTitle=Account Security accountSecurityIntroMessage=Control your password and account access @@ -270,7 +270,7 @@ removeAccessMessage=You will need to grant access again, if you want to use this #Authenticator authenticatorStatusMessage=Two-factor authentication is currently authenticatorFinishSetUpTitle=Your Two-Factor Authentication -authenticatorFinishSetUpMessage=Each time you sign in to your Keycloak account, you will be asked to provide a two-factor authentication code. +authenticatorFinishSetUpMessage=Each time you sign in to your HyperSign account, you will be asked to provide a two-factor authentication code. authenticatorSubTitle=Set Up Two-Factor Authentication authenticatorSubMessage=To enhance the security of your account, enable at least one of the available two-factor authentication methods. authenticatorMobileTitle=Mobile Authenticator @@ -278,7 +278,7 @@ authenticatorMobileMessage=Use mobile Authenticator to get Verification codes as authenticatorMobileFinishSetUpMessage=The authenticator has been bound to your phone. authenticatorActionSetup=Set up authenticatorSMSTitle=SMS Code -authenticatorSMSMessage=Keycloak will send the Verification code to your phone as the two-factor authentication. +authenticatorSMSMessage=HyperSign will send the Verification code to your phone as the two-factor authentication. authenticatorSMSFinishSetUpMessage=Text messages are sent to authenticatorDefaultStatus=Default authenticatorChangePhone=Change Phone Number diff --git a/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/home-page/home-page.component.html b/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/home-page/home-page.component.html index 27a4940964f7..e4b541903037 100644 --- a/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/home-page/home-page.component.html +++ b/themes/src/main/resources/theme/keycloak-preview/account/resources/app/content/home-page/home-page.component.html @@ -1,5 +1,5 @@
-

Welcome to Keycloak Account Management

+

Welcome to HyperSign Account Management

diff --git a/themes/src/main/resources/theme/keycloak/account/resources/img/keycloak_logo.png b/themes/src/main/resources/theme/keycloak/account/resources/img/keycloak_logo.png new file mode 100644 index 000000000000..cb734a74ff94 Binary files /dev/null and b/themes/src/main/resources/theme/keycloak/account/resources/img/keycloak_logo.png differ diff --git a/themes/src/main/resources/theme/keycloak/account/resources/img/logo.png b/themes/src/main/resources/theme/keycloak/account/resources/img/logo.png index a698c548ce5a..cb734a74ff94 100644 Binary files a/themes/src/main/resources/theme/keycloak/account/resources/img/logo.png and b/themes/src/main/resources/theme/keycloak/account/resources/img/logo.png differ diff --git a/themes/src/main/resources/theme/keycloak/admin/resources/img/JD.png b/themes/src/main/resources/theme/keycloak/admin/resources/img/JD.png new file mode 100644 index 000000000000..e78cf6999198 Binary files /dev/null and b/themes/src/main/resources/theme/keycloak/admin/resources/img/JD.png differ diff --git a/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.png b/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.png index ca53f0a04ba9..cb734a74ff94 100644 Binary files a/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.png and b/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.png differ diff --git a/themes/src/main/resources/theme/keycloak/login/resources/img/JD.png b/themes/src/main/resources/theme/keycloak/login/resources/img/JD.png new file mode 100644 index 000000000000..e78cf6999198 Binary files /dev/null and b/themes/src/main/resources/theme/keycloak/login/resources/img/JD.png differ diff --git a/themes/src/main/resources/theme/keycloak/login/resources/img/JDHard.png b/themes/src/main/resources/theme/keycloak/login/resources/img/JDHard.png new file mode 100644 index 000000000000..16a0e56db193 Binary files /dev/null and b/themes/src/main/resources/theme/keycloak/login/resources/img/JDHard.png differ diff --git a/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-bg.png b/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-bg.png index 4004db4420fa..ed1f3b7b6bbf 100644 Binary files a/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-bg.png and b/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-bg.png differ diff --git a/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-logo-text.png b/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-logo-text.png index 63f3b9f87deb..cb734a74ff94 100644 Binary files a/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-logo-text.png and b/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-logo-text.png differ diff --git a/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-logo.png b/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-logo.png index ffa5b0bf9e0e..cb734a74ff94 100644 Binary files a/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-logo.png and b/themes/src/main/resources/theme/keycloak/login/resources/img/keycloak-logo.png differ diff --git a/themes/src/main/resources/theme/keycloak/login/resources/imgJDHard.png b/themes/src/main/resources/theme/keycloak/login/resources/imgJDHard.png new file mode 100644 index 000000000000..16a0e56db193 Binary files /dev/null and b/themes/src/main/resources/theme/keycloak/login/resources/imgJDHard.png differ diff --git a/themes/src/main/resources/theme/keycloak/welcome/index.ftl b/themes/src/main/resources/theme/keycloak/welcome/index.ftl index 109bf081af2a..81cde5f68ac2 100755 --- a/themes/src/main/resources/theme/keycloak/welcome/index.ftl +++ b/themes/src/main/resources/theme/keycloak/welcome/index.ftl @@ -109,7 +109,7 @@
<#if properties.displayCommunityLinks = "true">

Mailing List

diff --git a/themes/src/main/resources/theme/keycloak/welcome/resources/bg.png b/themes/src/main/resources/theme/keycloak/welcome/resources/bg.png index b722a001b320..ed1f3b7b6bbf 100644 Binary files a/themes/src/main/resources/theme/keycloak/welcome/resources/bg.png and b/themes/src/main/resources/theme/keycloak/welcome/resources/bg.png differ diff --git a/themes/src/main/resources/theme/keycloak/welcome/resources/keycloak_logo.png b/themes/src/main/resources/theme/keycloak/welcome/resources/keycloak_logo.png index 134440b16ebf..cb734a74ff94 100644 Binary files a/themes/src/main/resources/theme/keycloak/welcome/resources/keycloak_logo.png and b/themes/src/main/resources/theme/keycloak/welcome/resources/keycloak_logo.png differ diff --git a/themes/src/main/resources/theme/keycloak/welcome/resources/logo.png b/themes/src/main/resources/theme/keycloak/welcome/resources/logo.png index 134440b16ebf..cb734a74ff94 100644 Binary files a/themes/src/main/resources/theme/keycloak/welcome/resources/logo.png and b/themes/src/main/resources/theme/keycloak/welcome/resources/logo.png differ