AzureAD/azure-activedirectory-library-for-java

Azure AD with Jdk 1.6 and Servlet web application

sathishscjp1 opened this issue · 3 comments

This is clarification regarding Azure AD integration with Java and J2EE (JSP and Servlet) base web application. Current web application details: It is legacy Java and J2EE(JSP and Servlet) based web application running in JDK 1.6, IBM WAS 8.5 with LDAP AD and site-minder as existing login mechanism. we are exploring possibility to replace login mechanism with Azure AD from LDAP AD. From different Microsoft documentation of Azure AD integration, we see that ADAL4J libraries are used and latest version of ADAL4J is 1.6.2,3 which uses Servlet API 4.0.1 which needs JDK 1.8. so we are trying to understand whether all features of Azure AD login mechanism work in JDK 1.6 version or JDK 1.8 upgrade is required.

Login mechanism, once user hit the application link, Microsoft Azure login link will be redirected for login and user can login to application post successful login in Microsoft azure login link.

Primary question is: For JAVA and J2EE (simple JSP and Servlet) web application, can we use Azure AD login mechanism work with JDK 1.6 version? or JDK 1.8 is mandatory?

if this work with JDK 1.6 then is there any features limitation or all Azure AD feature which will work in JDK 1.8 is applicable for JDK 1.6 as well? Please suggest what feature will differ.

Even if we check sample POM - the ADAL4j version is minimum 1.6.4

com.microsoft.azure
adal4j
1.6.0

Question2
When user hit the application link in browser, it reaches the apache2 server now and apach2 will redirect the control to site minder and user will enter user name and password then will be redirected to application post successful login. Here the site minder is configured in Apach2.
We are trying to mimic the similar configuration where Apache2 will redirect the control to Azure Ad and user will be redirected to application post successful login.

Primary question is, please suggest whether the same Apache2 server level configuration for redirection is possible with Azure AD or this needs to be handled at application code level. If possible then please share some documentation artifact.

Question3
Same requirement as question1 but this is for one other application which is running in JDK 1.7 , Oracle WebLogic Server 12.1.3, please suggest and share documentation artifact for apache2 server configuration

@sathishscjp1

  1. and 3) all features of adal will work with JDK 1.6. and JDK 1.7
  2. Redirect happens at the application level. See web sample for reference.

Hi,
Please find the below error when i am running the application.

[5/24/19 19:09:24:721 IST] 00000027 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\server1_4f125c00_19.05.24_19.09.24.6025902354203323141992.txt com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter 380
[5/24/19 19:09:24:750 IST] 00000027 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\server1_4f125c00_19.05.24_19.09.24.7226372188230210084359.txt com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper 166
[5/24/19 19:09:24:751 IST] 00000027 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[mvc-dispatcher]: java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=com/microsoft/aad/adal4j/AuthenticationException, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:264)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:74)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:830)
at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:745)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:568)
at java.lang.ClassLoader.loadClass(ClassLoader.java:650)
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:93)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:170)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:213)
at java.beans.Beans.instantiate(Beans.java:189)
at java.beans.Beans.instantiate(Beans.java:80)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:533)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:475)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:308)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:380)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:892)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3763)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:975)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:166)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1691)

Home Page

java.version ---:1.6.0
java.runtime.name ---:Java(TM) SE Runtime Environment
java.vm.vendor ---:IBM Corporation
java.runtime.version ---:pwa6460_26sr5ifx-20130314_01 (SR5)
java.vendor.url ---:http://www.ibm.com/
user.timezone ---:Asia/Calcutta
user.language ---:en
os.name ---:Windows 8

Updating issue for anyone who might see this in future: Apologies, I was mistaken when I said ADAL should work with Java 6. ADAL will only work with Java 7 and above. Discussion about this in #271