File tree Expand file tree Collapse file tree 4 files changed +315
-3
lines changed
src/main/java/org/sunbird/keycloak Expand file tree Collapse file tree 4 files changed +315
-3
lines changed Original file line number Diff line number Diff line change 121121 <!-- <scope>test</scope> -->
122122 </dependency >
123123
124- </dependencies >
124+
125+ <dependency >
126+ <groupId >org.apache.commons</groupId >
127+ <artifactId >commons-lang3</artifactId >
128+ <version >3.9</version >
129+ </dependency >
130+ </dependencies >
125131</project >
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ private enum CODE_STATUS {
7373 @ Override
7474 public void authenticate (AuthenticationFlowContext context ) {
7575 String secretKey = context .getAuthenticationSession ().getAuthNote (Constants .SECRET_KEY );
76- if (StringUtils .isBlank (secretKey )) {
76+ if (StringUtils .isBlank (secretKey )) {
7777 // Generate the secret key
7878 secretKey = generateSecretKey ();
7979 logger .info ("Generated new secret key." );
@@ -86,7 +86,13 @@ public void authenticate(AuthenticationFlowContext context) {
8686
8787 LoginFormsProvider formsProvider = context .form ();
8888 formsProvider .setAttribute (Constants .SECRET_KEY , secretKey );
89- context .challenge (formsProvider .createForm (Constants .LOGIN_PAGE ));
89+ if (context .getAuthenticationSession ().getRedirectUri ().contains (Constants .EC_LOGIN )){
90+ logger .info ("loading ec login page" );
91+ context .challenge (formsProvider .createForm (Constants .EC_LOGIN_PAGE ));
92+ }else {
93+ logger .info ("loading login page" );
94+ context .challenge (formsProvider .createForm (Constants .LOGIN_PAGE ));
95+ }
9096 }
9197
9298 @ Override
Original file line number Diff line number Diff line change @@ -106,4 +106,6 @@ private Constants() {
106106 public static final String ASYNC = "async" ;
107107 public static final String SECRET_KEY = "secretKey" ;
108108 public static final String IV = "iv" ;
109+ public static final String EC_LOGIN = "/eclogin/" ;
110+ public static final String EC_LOGIN_PAGE ="eclogin.ftl" ;
109111}
You can’t perform that action at this time.
0 commit comments