RADAR-base / RADAR-Rest-Source-Auth

A simple application to support authorization of wearable devices using OAuth using a webservice with REST Endpoints.
https://radar-base.org/
Apache License 2.0
1 stars 0 forks source link

The DELETE endpoint for source-clients authorization does not work without project id #148

Open yatharthranjan opened 2 years ago

yatharthranjan commented 2 years ago

The DELETE endpoint asks for a project id even though it should not be needed for deregistration and the permission is general SUBJECT.UPDATE (not on subject or project).

Logs for push endpoint. This is for request to endpoint DELETE "source-clients/Garmin/authorization/$serviceUserId?accessToken=$userAccessToken"

[2021-07-26 17:41:46,167] ERROR - [500] POST garmin/bodyCompositions
java.io.IOException: Failed to make request (HTTP status code 400){"error":"project_id_missing","error_description":"Missing project ID in request"}
    at org.radarbase.push.integration.garmin.user.GarminServiceUserRepository.makeRequest(GarminServiceUserRepository.kt:167)
    at org.radarbase.push.integration.garmin.user.GarminServiceUserRepository.deregisterUser(GarminServiceUserRepository.kt:113)
    at org.radarbase.push.integration.garmin.auth.GarminAuthValidator.verify(GarminAuthValidator.kt:44)
    at org.radarbase.push.integration.common.auth.DelegatedAuthValidator.verify(DelegatedAuthValidator.kt:33)
    at org.radarbase.jersey.auth.filter.AuthenticationFilter.filter(AuthenticationFilter.kt:43)
    at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:108)
    at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:44)
    at org.glassfish.jersey.process.internal.Stages.process(Stages.java:173)
    at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:247)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:356)
    at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:190)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
    at java.base/java.lang.Thread.run(Unknown Source)