Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-9481

Updating preferences in RA Web and CA UI with OAuth authentication

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: EJBCA 7.4.3
    • Component/s: RA UI
    • Labels:

      Description

      If you are logged in with an OAuth token in the RA Web, it is currently not possible to update the the preferences. You get an exception:

      16:36:28,605 WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (default task-13) #{raPreferencesBean.updatePreferences()}: java.lang.ClassCastException: org.cesecore.authentication.tokens.OAuth2AuthenticationToken cannot be cast to org.cesecore.authentication.tokens.X509CertificateAuthenticationToken: javax.faces.FacesException: #{raPreferencesBean.updatePreferences()}: java.lang.ClassCastException: org.cesecore.authentication.tokens.OAuth2AuthenticationToken cannot be cast to org.cesecore.authentication.tokens.X509CertificateAuthenticationToken
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:119)
              [...]
              at java.lang.Thread.run(Thread.java:748)
      Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: org.cesecore.authentication.tokens.OAuth2AuthenticationToken cannot be cast to org.cesecore.authentication.tokens.X509CertificateAuthenticationToken
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
              ... 68 more
      Caused by: java.lang.ClassCastException: org.cesecore.authentication.tokens.OAuth2AuthenticationToken cannot be cast to org.cesecore.authentication.tokens.X509CertificateAuthenticationToken
              at org.ejbca.ra.RaPreferencesBean.checkAdminHasRowInDbOrCreateOne(RaPreferencesBean.java:305)
              at org.ejbca.ra.RaPreferencesBean.updatePreferences(RaPreferencesBean.java:168)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              [...]
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
              ... 69 more
      

      A related problem exists in the AdminWeb on the "My Preferences" page.

        Attachments

          Activity

            People

            Assignee:
            samuel Samuel Lidén Borell
            Reporter:
            samuel Samuel Lidén Borell
            Verified by:
            Serkan Ongan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h