OAuth2SAMLBearerAssertion |
This brief is to showcase the SAP SuccessFactors extensibility service when used directly from SAP BTP, Kyma runtime environment. Please check the code sample below: |
main course | coffee corner |
|
|
Register an SAP SuccessFactors System in a Global Account in SAP BTP. The system registration is done on a SAP BTP Global Account level. The generated system registration token needs to be added in the SFSF Extension Center to complete the registration process. From now on, the SFSF system will be known to all sub-accounts under its symbolic system name. You can register the same SFSF system with several SAP BTP Global Accounts at a time. Likewise you may register several SFSF systems with one single SAP BTP Global Account. |
Configure the Entitlements for the SAP SuccessFactors Extensibility Service These extensibility service plans will be added automatically to every sub-account of the global account. But you will need to entitle them before being able to use them. Then you can look up the service in the service market place as follows: |
Create a Service Instance to Consume the SAP SuccessFactors HXM Suite OData API With sap-successfactors-extensibility service entitled on a BTP sub-account level you can start creating service instances with the api-access plan with Kyma runtime.Each service instance will result in creating:
Please note the externalName is the destination name!
Two api-access instances (shown above) have two corresponding OAuth2 client applications as depicted below: Good to know:
|
Configure Single Sign-On Between a Subaccount in SAP BTP and SAP SuccessFactors Quoting after SAP help: SAP BTP supports the following authentication scenarios for SAP SuccessFactors: Steps
Good to know:
|
https://<tenant>.launchpad.cfapps.<region>.hana.ondemand.com/dynamic_dest/Quovadis-SAP-JWT/odata/v2/...
https://<tenant>.launchpad.cfapps.<region>.hana.ondemand.com/dynamic_dest/Quovadis-SAP-JWT/odata/v2/...
Indeed, CAPire is a popular cloud programming framework with SAP BTP runtime environments. There is plenty of public code samples with CAP applications with both CF and Kyma runtimes. There is also a great deal of blogs, tutorials, and an excellent CAP documentation. So what about using a wizard, a code generator to help scaffold a minimal viable CAP application and even deploy it straight away to your kyma cluster? |
$ yo saphanaacademy-cap
prompt | value |
---|---|
? What project name would you like? | sfk8s |
? Would you like to create a new directory for this project? | Yes |
? What is the display name of your app? | sfk8s |
? What is the description of your app? | sfk8s |
? Which runtime will you be deploying the project to? | SAP BTP, Kyma runtime |
? What SAP BTP, Kyma runtime namespace will you be deploying to? | <namespace> |
? What is your Docker ID? | <docker_id> |
? What is your Docker repository name? Leave blank to create a separate repository for each microservice. | <docker_repo_name> |
? What is your Docker repository visibility? | Private (Only visible to you) |
? What is the name of your Docker Registry Secret? It will be created in the namespace if you specify your Docker Email Address and Docker Personal Access Token or Password. | docker-registry-config |
? What is your Docker Server URL? | https://index.docker.io/v1/ |
? What is your Docker Email Address? Leave blank if your Docker Registry Secret already exists in the namespace. | <docker hub user email address> |
? What is your Docker Personal Access Token or Password? Leave blank if your Docker Registry Secret already exists in the namespace. | <docker hub user password/token> |
? What is the path of your Kubeconfig file? Leave blank to use the KUBECONFIG environment variable instead. | /Users/<username>/.kube/kubeconfig--team-kyma.yaml |
? How would you like to build container images? | Paketo (Cloud Native Buildpacks) |
? Will you be using an existing SAP HANA Cloud HDI Container? If so please enter the HDI Container service instance name here or leave blank for none. | |
? Will you be using an existing SAP HANA Cloud schema? If so please enter the schema name here or leave blank for none. Note: schema names in mixed case are case sensitive! | |
? Would you like to create an entity with SAP HANA Cloud persistence? | No |
? Would you like to use an external API? | Yes |
? Which external API(s) would you like to use? | SAP SuccessFactors Recruiting, SAP SuccessFactors Employee Central |
? What is the name of your SAP SuccessFactors Extensibility service instance (api-access plan)? Leave blank for the SAP API Business Hub sandbox. | Quovadis-SAP |
? What is your API Key for the SAP API Business Hub sandbox? | ******************************** |
? Would you like authentication? | Yes |
? Would you like authorization? | Yes |
? Would you like to configure an App2App authorization scenario? | No |
? Would you like to enable OData v2 support? | No |
? Would you like a UI? | Yes |
? Would you like to use the HTML5 Application Repository? | No |
? Will you be using a wildcard custom domain (eg: apps.domain.com)? If so please enter the custom domain name here. Leave blank to use the platform default. | <shoot>.kyma.ondemand.com |
? What is the gateway for the custom domain in your SAP BTP, Kyma runtime? | kyma-gateway.kyma-system.svc.cluster.local |
? Would you like to configure external session management (using Redis)? | No |
? Would you like to include an additional backend service using SAP Cloud Application Programming Model? | No |
? Would you like to include an additional backend service using regular Node.js? | No |
? Would you like to enable messaging with SAP Event Mesh? | No |
? Would you like to enable Continuous Integration and Delivery (CI/CD)? | No |
? Would you like to enable GraphQL? | No |
? Would you like to enable a Swagger UI? | No |
? Would you like to build and deploy the project immediately? | No |
📦srv
┣ 📂external
┃ ┣ 📜ECEmploymentInformation.csn
┃ ┣ 📜ECEmploymentInformation.edmx
┃ ┣ 📜RCMCandidate.csn
┃ ┗ 📜RCMCandidate.edmx
┣ 📜Dockerfile
┣ 📜catalog-service.cds
┗ 📜catalog-service.js
📦app
┣ 📂resources
┃ ┣ 📂html5
┃ ┃ ┗ 📂webapp
┃ ┃ ┃ ┣ 📜index.html
┃ ┃ ┃ ┗ 📜map.html
┃ ┗ 📜index.html
┣ 📜Dockerfile
┣ 📜package.json
┗ 📜xs-app.json
You can test your project locally from the command line as follows:
cd sfk8s
cds watch
You can build and deploy your project as follows or use a CI/CD pipeline:
cd sfk8s
make docker-push
make helm-deploy
{
"name": "sfk8s",
"version": "0.0.1",
"repository": "<Add your repository here>",
"license": "UNLICENSED",
"description": "sfk8s",
"engines": {
"node": "^18"
},
"dependencies": {
"@sap/cds": "^6.8",
"@sap/audit-logging": "^5",
"@sap-cloud-sdk/http-client": "latest",
"@sap/xsenv": "latest",
"@sap/xssec": "latest",
............
,
"RCMCandidate": {
"kind": "odata-v2",
"model": "srv/external/RCMCandidate",
"credentials": {
"[production]": {
"destination": "Quovadis-SAP",
"path": "odata/v2"
},
"[development]": {
"url": "https://sandbox.api.sap.com/successfactors/odata/v2"
}
}
}
,
"ECEmploymentInformation": {
"kind": "odata-v2",
"model": "srv/external/ECEmploymentInformation",
"credentials": {
"[production]": {
"destination": "Quovadis-SAP",
"path": "odata/v2"
},
"[development]": {
"url": "https://sandbox.api.sap.com/successfactors/odata/v2"
}
}
}
}
}
}
$ cd sfk8s/
$ make docker-push
cds build --production
[cds] - the following build tasks will be executed
[cds] - {
"build": {
"target": "gen",
"tasks": [
{"for":"nodejs", "src":"srv", "options":{"model":["srv","app","srv/external/RCMCandidate","srv/external/ECEmploymentInformation"]}}
]
}
}
[cds] - building project [/Users/<username>/.kube/sfk8s], clean [true]
[cds] - cds [6.8.1], compiler [3.9.2], home [/Users/<user name>/.kube/sfk8s/node_modules/@sap/cds]
[cds] - done > wrote output to:
gen/srv/package-lock.json
gen/srv/package.json
gen/srv/srv/Dockerfile
gen/srv/srv/catalog-service.js
gen/srv/srv/csn.json
gen/srv/srv/external/ECEmploymentInformation.edmx
gen/srv/srv/external/RCMCandidate.edmx
[cds] - build completed in 1496 ms
pack build <docker_id>/<docker_repo>:sfk8s-srv -p gen/srv -B paketobuildpacks/builder:base
....................
📦gen
┗ 📂srv
┃ ┣ 📂srv
┃ ┃ ┣ 📂external
┃ ┃ ┃ ┣ 📜ECEmploymentInformation.edmx
┃ ┃ ┃ ┗ 📜RCMCandidate.edmx
┃ ┃ ┣ 📜Dockerfile
┃ ┃ ┣ 📜catalog-service.js
┃ ┃ ┗ 📜csn.json
┃ ┣ 📜package-lock.json
┃ ┗ 📜package.json
📦helm
┣ 📂sfk8s-app
┃ ┣ 📂templates
┃ ┃ ┣ 📜NOTES.txt
┃ ┃ ┣ 📜_helpers.tpl
┃ ┃ ┣ 📜apirule.yaml
┃ ┃ ┣ 📜configmap.yaml
┃ ┃ ┣ 📜deployment.yaml
┃ ┃ ┗ 📜service.yaml
┃ ┣ 📜.helmignore
┃ ┣ 📜Chart.yaml
┃ ┗ 📜values.yaml
┗ 📂sfk8s-srv
┃ ┣ 📂templates
┃ ┃ ┣ 📜NOTES.txt
┃ ┃ ┣ 📜_helpers.tpl
┃ ┃ ┣ 📜apirule.yaml
┃ ┃ ┣ 📜binding-dest.yaml
┃ ┃ ┣ 📜binding-uaa.yaml
┃ ┃ ┣ 📜configmap.yaml
┃ ┃ ┣ 📜deployment.yaml
┃ ┃ ┣ 📜service-dest.yaml
┃ ┃ ┣ 📜service-uaa.yaml
┃ ┃ ┗ 📜service.yaml
┃ ┣ 📜.helmignore
┃ ┣ 📜Chart.yaml
┃ ┗ 📜values.yaml
$ make helm-deploy
helm upgrade -n team-kyma -i sfk8s-srv helm/sfk8s-srv --install --kubeconfig /Users/<username>/.kube/kubeconfig--team-kyma.yaml
Release "sfk8s-srv" does not exist. Installing it now.
NAME: sfk8s-srv
LAST DEPLOYED: *************
NAMESPACE: team-kyma
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing sfk8s-srv. Your release is named sfk8s-srv and was deployed to the namespace team-kyma.
helm upgrade -n team-kyma -i sfk8s-app helm/sfk8s-app --install --kubeconfig /Users/<username/>.kube/kubeconfig--team-kyma.yaml
Release "sfk8s-app" does not exist. Installing it now.
NAME: sfk8s-app
LAST DEPLOYED: *************
NAMESPACE: team-kyma
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing sfk8s-app. Your release is named sfk8s-app and was deployed to the namespace team-kyma.
$ make helm-undeploy
Permission Role List | Permission Role Detail |
You need to pick a permission role (the one which your admin user has been assigned to) and make sure it has the required permissions | I have chosen a System Admin role as the sfadmin user has this role assigned |
Create Integration with SAP BTP | Admin access to MDF OData API |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
27 | |
25 | |
19 | |
14 | |
13 | |
11 | |
10 | |
9 | |
7 | |
7 |