Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenIdAuthenticationDefinition javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier /FISH-84 #4469

Closed
sharpedavid opened this issue Feb 4, 2020 · 1 comment · Fixed by #5212
Assignees
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect

Comments

@sharpedavid
Copy link

sharpedavid commented Feb 4, 2020

Description

I'm attempting to use Expression Language with a CDI Bean to configure OpenIdAuthenticationDefinition as described in the documentation here https://docs.payara.fish/documentation/payara-server/public-api/openid-connect-support.html.

Additionally, the @OpenIdAuthenticationDefinition supports the use of expression language (EL) notation for dynamic configuration scenarios. This means that you can use any CDI bean properties to set the OpenID Connect configuration like this:

My problem is that I'm able to use EL in a WAR, but it often fails when I attempt to put the WAR in an EAR.

Expected Outcome

I expect to be able to configure OpenIdAuthenticationDefinition using Expression Language with a CDI Bean in a WAR file in an EAR file.

I have linked to a complete example below in "Steps to Reproduce", but here is a brief demonstration:

package ca.bc.gov.health.security;
import fish.payara.security.annotations.OpenIdAuthenticationDefinition;

@OpenIdAuthenticationDefinition(
       providerURI = "#{myConfigBean.myvalue}",
       clientId = "ElBugExample",
       clientSecret = "someSecret",
       redirectURI = "#{myConfigBean.myvalue}",
       scope = { "openid" }

)
public class KeycloakSecurityBean {
    
}
package ca.bc.gov.health.security;

import javax.inject.Named;

@Named
public class MyConfigBean {
    
    private String myvalue = "mouse8";

    public String getMyvalue() {
        return myvalue;
    }
    
}

Current Outcome

Sometimes the Expression Language look-up succeeds, and sometimes it fails. When it fails, it generates this error message:

javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier 'myConfigBean'

When it succeeds, it generates this error message:

javax.ws.rs.ProcessingException: URI is not absolute

This error message is expected in the successful case because I've intentionally used a bad URI because I don't want to complicate things by including an OpenId Provider.

Steps to reproduce

https://github.com/sharpedavid/el-bug-example

See the README.md file for more details.

Environment

  • Payara Version: Payara Server 5.192
  • Edition: Full
  • JDK Version: Oracle JDK 8
  • Operating System: Windows
@OndroMih
Copy link
Contributor

OndroMih commented Feb 6, 2020

Hi, I was able to reproduce very easily, thanks for the reproducer.

@OndroMih OndroMih changed the title OpenIdAuthenticationDefinition javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier OpenIdAuthenticationDefinition javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier / CUSTCOM-186 Feb 6, 2020
@OndroMih OndroMih added the Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev label Feb 6, 2020
@OndroMih OndroMih removed their assignment Mar 3, 2020
@fturizo fturizo added the Type: Bug Label issue as a bug defect label Nov 12, 2020
@fturizo fturizo changed the title OpenIdAuthenticationDefinition javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier / CUSTCOM-186 OpenIdAuthenticationDefinition javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier /FISH-84 Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants