Uploaded image for project: 'OpenICF'
  1. OpenICF
  2. OPENICF-1087

GoogleApps Connector: DELETE on self should return 400 Bad Request

    Details

      Description

      When deleting self admin account, google apps returns 500 error. This error should be correctly mapped to 400 Bad Request Error

      DELETE http://localhost:8080/openidm/system/google/__ACCOUNT__/118068600160205461391
      {
        "code": 500,
        "reason": "Internal Server Error",
        "message": "Operation DELETE failed with ConnectorException on system object"
      }
      
      WARNING: Resource exception: 500 Internal Server Error: "Operation DELETE failed with ConnectorException on system object"
      org.forgerock.json.resource.InternalServerErrorException: Operation DELETE failed with ConnectorException on system object
      	at org.forgerock.openidm.provisioner.openicf.impl.ExceptionHelper.adaptConnectorException(ExceptionHelper.java:159)
      	at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassResourceProvider.handleDelete(ObjectClassResourceProvider.java:335)
      	at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassRequestHandler.handleDelete(ObjectClassRequestHandler.java:111)
      	at org.forgerock.json.resource.Router.handleDelete(Router.java:279)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:75)
      	at org.forgerock.json.resource.ResourceApiVersionRoutingFilter.filterDelete(ResourceApiVersionRoutingFilter.java:55)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:73)
      	at org.forgerock.json.resource.FilterChain.handleDelete(FilterChain.java:238)
      	at org.forgerock.json.resource.Router.handleDelete(Router.java:279)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:75)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:64)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:73)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:64)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:73)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.lambda$filterDelete$2(DelegatedAdminFilter.java:197)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:227)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterRequest(DelegatedAdminFilter.java:252)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterDelete(DelegatedAdminFilter.java:196)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:73)
      	at org.forgerock.openidm.audit.filter.AuditFilter.lambda$filterDelete$2(AuditFilter.java:127)
      	at org.forgerock.openidm.audit.filter.AuditFilter.logAuditAccessEntry(AuditFilter.java:171)
      	at org.forgerock.openidm.audit.filter.AuditFilter.filterDelete(AuditFilter.java:127)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterDelete(MutableFilterDecorator.java:78)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:73)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.lambda$filterDelete$2(ServletConnectionFactory.java:385)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.handleRequestWithLogging(ServletConnectionFactory.java:430)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.filterDelete(ServletConnectionFactory.java:385)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:73)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterDelete(PassthroughFilter.java:54)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterDelete(MutableFilterDecorator.java:78)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterDelete(MutableFilterDecorator.java:78)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:73)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterDelete(PassthroughFilter.java:54)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterDelete(MutableFilterDecorator.java:78)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:73)
      	at org.forgerock.json.resource.FilterChain.handleDelete(FilterChain.java:238)
      	at org.forgerock.json.resource.InternalConnection.deleteAsync(InternalConnection.java:47)
      	at org.forgerock.json.resource.AbstractConnectionWrapper.deleteAsync(AbstractConnectionWrapper.java:119)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.lambda$deleteAsync$7(ServletConnectionFactory.java:329)
      	at org.forgerock.openidm.metrics.MetricsCollector.time(MetricsCollector.java:112)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.time(ServletConnectionFactory.java:286)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.deleteAsync(ServletConnectionFactory.java:329)
      	at org.forgerock.json.resource.http.RequestRunner.visitDeleteRequest(RequestRunner.java:195)
      	at org.forgerock.json.resource.http.RequestRunner.visitDeleteRequest(RequestRunner.java:84)
      	at org.forgerock.json.resource.Requests$DeleteRequestImpl.accept(Requests.java:313)
      	at org.forgerock.json.resource.http.RequestRunner.handleResult(RequestRunner.java:132)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:252)
      	at org.forgerock.json.resource.http.HttpAdapter.doRequest(HttpAdapter.java:739)
      	at org.forgerock.json.resource.http.HttpAdapter.doDelete(HttpAdapter.java:347)
      	at org.forgerock.json.resource.http.HttpAdapter.handle(HttpAdapter.java:303)
      	at org.forgerock.http.handler.Handlers$HandlerDescribableAsDescribableHandler.handle(Handlers.java:146)
      	at org.forgerock.http.filter.OptionsFilter.filter(OptionsFilter.java:69)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.http.routing.Router.handle(Router.java:100)
      	at org.forgerock.http.swagger.OpenApiRequestFilter.filter(OpenApiRequestFilter.java:63)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.openidm.auth.ProfileEnhancementCheckFilter.filter(ProfileEnhancementCheckFilter.java:145)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.openidm.auth.LoginCountFilter.filter(LoginCountFilter.java:60)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.grantAccess(AuthenticationFramework.java:188)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.lambda$onValidateRequestSuccess$1(AuthenticationFramework.java:181)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:252)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.validateRequest(AuthenticationFramework.java:144)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.processMessage(AuthenticationFramework.java:134)
      	at org.forgerock.caf.authentication.framework.AuthenticationFilter.filter(AuthenticationFilter.java:84)
      	at org.forgerock.openidm.auth.AuthFilterWrapper.filter(AuthFilterWrapper.java:85)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.http.filter.TransactionIdInboundFilter.filter(TransactionIdInboundFilter.java:86)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.http.servlet.HttpFrameworkServlet.service(HttpFrameworkServlet.java:264)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:311)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:265)
      	at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:302)
      	at com.sun.proxy.$Proxy72.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
      	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
      	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
      	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
      	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:690)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.Server.handle(Server.java:503)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.identityconnectors.framework.common.exceptions.ConnectorException: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
      {
        "code" : 400,
        "errors" : [ {
          "domain" : "global",
          "message" : "Admin cannot delete self.",
          "reason" : "badRequest"
        } ],
        "message" : "Admin cannot delete self."
      }
      	at org.identityconnectors.framework.common.exceptions.ConnectorException.wrap(ConnectorException.java:99)
      	at org.forgerock.openicf.connectors.googleapps.GoogleAppsConnector.execute(GoogleAppsConnector.java:1680)
      	at org.forgerock.openicf.connectors.googleapps.GoogleAppsConnector.execute(GoogleAppsConnector.java:1622)
      	at org.forgerock.openicf.connectors.googleapps.GoogleAppsConnector.delete(GoogleAppsConnector.java:408)
      	at org.identityconnectors.framework.impl.api.local.operations.DeleteImpl.delete(DeleteImpl.java:65)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.identityconnectors.framework.impl.api.local.operations.ConnectorAPIOperationRunnerProxy.invoke(ConnectorAPIOperationRunnerProxy.java:104)
      	at com.sun.proxy.$Proxy82.delete(Unknown Source)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.identityconnectors.framework.impl.api.local.operations.ThreadClassLoaderManagerProxy.invoke(ThreadClassLoaderManagerProxy.java:96)
      	at com.sun.proxy.$Proxy82.delete(Unknown Source)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.identityconnectors.framework.impl.api.DelegatingTimeoutProxy.invoke(DelegatingTimeoutProxy.java:98)
      	at com.sun.proxy.$Proxy82.delete(Unknown Source)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.identityconnectors.framework.impl.api.local.LocalConnectorFacadeImpl$ReferenceCountingProxy.invoke(LocalConnectorFacadeImpl.java:304)
      	at com.sun.proxy.$Proxy82.delete(Unknown Source)
      	at org.identityconnectors.framework.impl.api.AbstractConnectorFacade.delete(AbstractConnectorFacade.java:219)
      	at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassResourceProvider.handleDelete(ObjectClassResourceProvider.java:321)
      	... 115 more
      Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
      {
        "code" : 400,
        "errors" : [ {
          "domain" : "global",
          "message" : "Admin cannot delete self.",
          "reason" : "badRequest"
        } ],
        "message" : "Admin cannot delete self."
      }
      	at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150)
      	at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
      	at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:417)
      	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1049)
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:515)
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:448)
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:565)
      	at org.forgerock.openicf.connectors.googleapps.GoogleAppsConnector.execute(GoogleAppsConnector.java:1638)
      	... 144 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                petr.jurica Petr Jurica [X] (Inactive)
                Reporter:
                michal.orlik@profiq.cz Michal Orlik
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: