3 weeks ago - last edited 3 weeks ago
Hello
I'd like to create a simple user management API to consume the SCIM API of SAP IAS.
I got as a result : <html><body>No service was found.</body></html>
Here are the steps I followed :
1 - creation of a destination in CF :
2 - setting my xs-app.json :
{
"authenticationMethod": "route",
"routes": [
{
"source": "^/api(.*)$",
"target": "/api/$1",
"destination": "IAS_Identity_Directory",
"authenticationType": "xsuaa",
"csrfProtection": false
}
]
}
3 - updating the ui5-local.yaml :
# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json
specVersion: "3.1"
metadata:
name: com.vesi.zfamanage
type: application
server:
customMiddleware:
- name: fiori-tools-proxy
afterMiddleware: compression
configuration:
ignoreCertError: false # Ignore certificate errors for local development
backend:
- path: /api
destination: IAS_Identity_Directory
- name: fiori-tools-appreload
afterMiddleware: compression
configuration:
port: 35729
path: webapp
delay: 300
- name: fiori-tools-preview
afterMiddleware: fiori-tools-appreload
configuration:
component: com.vesi.zfamanage
ui5Theme: sap_horizon
4 - requesting the right path with a simple ajax call :
onInit: function () {
this._fetchUsers();
},
_fetchUsers: function () {
var sUrl = "/api/scim/Users";
$.ajax({
url: sUrl,
method: "GET",
contentType: "application/scim+json",
dataType: "json",
success: function (data) {
console.log("Users retrieved:", data);
MessageToast.show("Users retrieved successfully!");
},
error: function (err) {
console.error("Error fetching users:", err);
MessageToast.show("Error fetching users");
}
});
}
I tried differents paths and approach without any success maybe I'm missing something on the connectivity part of BTP.
From Postman, I'm able to request the API.
Thank you in advance for your help! 🙂
You still need to assign the role to your site in the Site Directory. Once you've done that, it will create a role collection in BTP which you can assign to a CIS User Group or directly to a user, see documentation:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you check the network trace?
The url of your ajax call needs to be added to the hostname + unique id of the app and not just after the hostname. In that case, it won't be resovled by the approuter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
9 | |
8 | |
7 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.