diff --git a/src/main/kotlin/de/fraunhofer/iem/dataprovider/repository/service/RepositoryService.kt b/src/main/kotlin/de/fraunhofer/iem/dataprovider/repository/service/RepositoryService.kt index 583c758e7d2fc70569b8063251b4563cbf0ae5c5..4bd7ae9782f9c4424c7c9ca679ee34bbb5a54965 100644 --- a/src/main/kotlin/de/fraunhofer/iem/dataprovider/repository/service/RepositoryService.kt +++ b/src/main/kotlin/de/fraunhofer/iem/dataprovider/repository/service/RepositoryService.kt @@ -94,7 +94,7 @@ class RepositoryService( suspend fun validateUser(validateUserDto: ValidateUserDto) { val userCookie = httpClient.get(openCodeApiProperties.auth) { url { - appendPathSegments(validateUserDto.b) + appendPathSegments("receive-session", validateUserDto.b) parameters.append("apiKey", openCodeApiProperties.authApiKey) } } @@ -103,16 +103,19 @@ class RepositoryService( println(userCookie.body<Any>()) val setCookies = userCookie.setCookie() println(setCookies) - + val sessionCookie = setCookies.first { it.name == "session" } val me = httpClient.get(openCodeApiProperties.auth) { url { appendPathSegments("me") parameters.append("apiKey", openCodeApiProperties.authApiKey) +// cookie(name = "session", value = sessionCookie.value) } } println(me) println(me.body<Any>()) +// val user = me.body<UserResponseDto>() +// user.userDetails.gitlabProfile } } diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index f9d08a89c818075b0527fdf54ec1f132fff43fbf..b2ef471ba81753bd0b4e7e45de3d591d9edaf22e 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -8,7 +8,7 @@ opencode.user-name=${OC_GL_USER:} # Tool APIs opencode.api.base-path=https://sl.dev.o4oe.de/api/v1/project/ opencode.api.ort=/cve-result -opencode.api.auth=https://sl.dev.o4oe.de/api/receive-session +opencode.api.auth=https://sl.dev.o4oe.de/api/ opencode.api.auth-api-key=${AUTH_API_KEY} # API key to access this server's API