Skip to content
Advertisement

Unable to get the AuthenticationResult after redirecting to java web-app

I am trying to integrate azure ad into a java web application using openidconnect approach. My web application is deployed on weblogic application server.

Reference: microsoft doc

Base code that I used is from microsoft github repo: Link

After integration, I was able to redirect my login page to Microsoft login page, entered credential and then when Microsoft redirects back to my login page, it lands in below controller which is my redirect reply URL, here the result object (AuthenticationResult) is null. The session object doesn’t seem to have attribute called ‘principle’. I am not sure where I have gone wrong, can anyone please point me in the right direction?

JavaScript

Update #1: I tried to print contents of my HttpSession by enumerating on it and I find that it has just one attribute called ‘states’ which is empty as well.

From my logs:

JavaScript

Update #2: I tried to print attributes of HttpServletRequest object by enumerating on it and one of the attribute is called error which has this value.

JavaScript

Advertisement

Answer

After adding more logs as suggested by @Allen Wu, I was able to finally obtain a glaring stacktrace :

JavaScript

The nimbusds site says their latest release supports JDK 7+ versions, but the latest jar version 9.9.3 supports from JDK 8+ only, hence the above error. After I replaced with version 7.8 (randomly picked a lower version) the application worked right away.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement