GluuFederation / oxTrust

Gluu Server UI for managing authentication, authorization and users.
https://gluu.org/docs/ce
MIT License
134 stars 60 forks source link

Issues with "Client's registration expires" control of OIDC client's properties page #1284

Closed aliaksander-samuseu closed 5 years ago

aliaksander-samuseu commented 5 years ago

Environment:

CentOS 7.4, gluu-server-3.1.4

Steps to reproduce:

  1. Log in to web UI
  2. Open an OIDC client for editing
  3. Find "Clean" button in "Client's registration expires" control and click it to clear the time
  4. Click the "Update" button to save the change

Result: User is sent to /identity/error page with a general error message. Changes are not applied to the client's entry. A Java error trace is registered in oxtrust.log:

2018-10-01 20:57:22,408 DEBUG [qtp1094834071-17] [org.gluu.oxtrust.exception.GlobalExceptionHandler] (GlobalExceptionHandler.java:61) - #{updateClientAction.save}: java.lang.NullPointerException
javax.faces.FacesException: #{updateClientAction.save}: java.lang.NullPointerException
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:89) ~[javax.faces-2.2.16.jar:2.2.16]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [javax.faces-2.2.16.jar:2.2.16]
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [javax.faces-2.2.16.jar:2.2.16]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658) [javax.faces-2.2.16.jar:2.2.16]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:857) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226) [rewrite-servlet-3.4.2.Final.jar:3.4.2.Final]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]

Another issue with this control is that when non-expiring clients' entries exist in the system (for example, when migrated from older packages during upgrade process), this control doesn't appear for them at all, so user can't set expiration for them if they would like to.

Expected result:

  1. The control should allow complete clearance of expiration date, turning the client entry into non-expiring (permanent) - as it was possible in the previous packages. This is usually the result you expect when creating it manually (expiration makes more sense for auto-enrolled clients)
  2. Even if a client's entry is of a permanent type, the control still must be displayed in its properties, allowing user to turn it into expiring entry at any time.
syntrydy commented 5 years ago

@aliaksander-samuseu I fixed it as requested.

Existing clients now also display the calendar hence user can change their expiration date. When new client is create without expiration date we set it to current date+one century. Note that the field is of type date so only date value as accepted.

natt-tester commented 5 years ago

The enhancement is implemented and tested. DONE.

@aliaksander-samuseu I fixed it as requested.

Existing clients now also display the calendar hence user can change their expiration date. When new client is create without expiration date we set it to current date+one century. Note that the field is of type date so only date value as accepted.

obraz