You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewErrorWithCause(`Could not parse ${name} URL: ${url}`,err);
21
+
}
22
+
}
23
+
18
24
/**
19
25
* @internal
20
26
* @param credentials - Identity service credentials extracted from a service binding or re-use service. Required to create the xssec IdentityService instance.
27
+
* @param assertion - Optional JWT assertion to extract the issuer URL for bearer assertion flows.
21
28
* @param disableCache - Value to enable or disable JWKS cache in xssec library. Defaults to false.
22
29
* @returns An instance of {@code @sap/xssec/IdentityService} for the provided credentials.
@@ -99,8 +100,19 @@ export async function getIasClientCredentialsToken(
99
100
tenantId: fnArgument.serviceCredentials.tenantid
100
101
}
101
102
}).catch(err=>{
102
-
thrownewError(
103
-
`Could not fetch IAS client credentials token for service of type ${resolvedService.label}: ${err.message}`
103
+
constserviceName=
104
+
typeofservice==='string' ? service : service.name||'unknown';
105
+
letmessage=`Could not fetch IAS client credentials token for service "${serviceName}" of type ${resolvedService.label}`;
106
+
107
+
// Add contextual hints based on error status code (similar to Java SDK)
108
+
if(err.response?.status===401){
109
+
message+=
110
+
'. In case you are accessing a multi-tenant BTP service on behalf of a subscriber tenant, ensure that the service instance is declared as dependency to SaaS Provisioning Service or Subscription Manager (SMS) and subscribed for the current tenant';
111
+
}
112
+
113
+
thrownewErrorWithCause(
114
+
message+(err.message ? `: ${err.message}` : '.'),
115
+
err
104
116
);
105
117
});
106
118
returntoken;
@@ -138,7 +150,8 @@ async function getIasClientCredentialsTokenImpl(
0 commit comments