From bb98774b41473eb3bbc24073ed5f5e73eba16761 Mon Sep 17 00:00:00 2001 From: hemantxpatel Date: Mon, 29 Apr 2024 12:57:42 +0530 Subject: [PATCH] Fix STS Token API Response --- .../controller/SecureTokenController.java | 2 +- .../managedidentitywallets/domain/StsTokenResponse.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/SecureTokenController.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/SecureTokenController.java index 82e74e1e9..1027d6f48 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/SecureTokenController.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/SecureTokenController.java @@ -139,7 +139,7 @@ private ResponseEntity processTokenRequest(SecureTokenRequest .token(responseJwt.serialize()) .expiresAt(responseJwt.getJWTClaimsSet().getExpirationTime().getTime()) .build(); - return ResponseEntity.status(HttpStatus.CREATED).body(response); + return ResponseEntity.status(HttpStatus.OK).body(response); } @ExceptionHandler({ UnsupportedGrantTypeException.class, InvalidSecureTokenRequestException.class, UnknownBusinessPartnerNumberException.class, InvalidIdpTokenResponseException.class }) diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/domain/StsTokenResponse.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/domain/StsTokenResponse.java index 2e78cfff0..50161b118 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/domain/StsTokenResponse.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/domain/StsTokenResponse.java @@ -21,6 +21,7 @@ package org.eclipse.tractusx.managedidentitywallets.domain; +import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -33,6 +34,9 @@ @NoArgsConstructor @AllArgsConstructor public class StsTokenResponse { + + @JsonProperty("access_token") private String token; + private long expiresAt; }