SAP / SAP/cloud-sdk-java

tryGetDestination() fails with "Failed to get destination" for NoAuthentication+IAS destination in subscriber tenant context

Offen
#1,280 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
Java
Sterne
41
Forks
33
Ø Merge
18 Std. 34 Min.
Gemergte PRs (30 T.)
19

Beschreibung

Describe the Bug

When calling DestinationAccessor.getLoader().tryGetDestination("OneSimAPI_Destination") in a subscriber tenant context, the SDK fails with "Failed to get destination." for a destination configured with
Authentication=NoAuthentication and IAS-based M2M properties (cloudsdk.ias-dependency-name, tokenService.body.url).

The same destination is successfully returned by DestinationService.getAllDestinationProperties() (metadata-only call). The failure happens only during the full resolution via tryGetDestination.

This works correctly for another tenant on the same landscape with the same destination configuration (same auth type, same dependency name, different tokenService.body.url).

Steps to Reproduce
  1. Configure a BTP destination in a subscriber subaccount with:
    • Authentication: NoAuthentication
    • cloudsdk.ias-dependency-name: sim-supplier-search-api
    • tokenService.body.url: https://.accounts.ondemand.com
  2. Call DestinationAccessor.getLoader().tryGetDestination("OneSimAPI_Destination") in the context of the subscriber tenant
  3. Observe failure with "Failed to get destination."
Expected Behavior

tryGetDestination() should successfully resolve the destination. Since the auth type is NoAuthentication, the SDK should not attempt user token exchange. The destination should be returned with its properties so
our code can handle the IAS token fetch separately using the cloudsdk.ias-dependency-name and tokenService.body.url properties.

Screenshots

No response

Used Versions
  • SAP Cloud SDK: 5.20.0
  • Java: 21
  • Spring Boot: 3.x
  • Landscape: CF EU30 (prod)
Code Examples

// Our call in DestinationCallProcessor.java
private Try tryGetDestination(String destinationName) {
return DestinationAccessor.getLoader().tryGetDestination(destinationName);
}

Destination configuration (sensitive values removed):
{
"Name": "OneSimAPI_Destination",
"Type": "HTTP",
"Authentication": "NoAuthentication",
"ProxyType": "Internet",
"URL": "https://.prod-eu30.supplier-info-management.procurement.cloud.sap/api/ambassador-srv-api/v1",
"cloudsdk.ias-dependency-name": "sim-supplier-search-api",
"tokenService.body.url": "https://.accounts.ondemand.com"
}

Stack Trace

No response

Log File
Log file ...
Affected Development Phase

Production

Impact

Blocked

Timeline

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei DestinationAccessor.getLoader().tryGetDestination und vergleiche dessen Auflösungspfad mit DestinationService.getAllDestinationProperties(). Reproduziere den Fall eines Subscriber-Tenants mit den angegebenen NoAuthentication- und IAS-Eigenschaften und verfolge, warum die vollständige Auflösung fehlschlägt, während die Metadaten erfolgreich abgerufen werden. Erledigt ist die Aufgabe, wenn tryGetDestination die Destination ohne Benutzertoken-Austausch zurückgibt und die IAS-bezogenen Eigenschaften beibehält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, spring-boot
Bereich
backend, cloud
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.