on 03-31-2023 7:52 PM
Hello ,
I have built an XSA Application and trying to secure the UI5 application with UAA.
I have created a xs-security.json file which has the roles and these roles are linked to UAA. The below code snippet is from mta.yaml file
- name: UAA-service_test1
type: com.sap.xs.uaa
parameters:
path: xs-security.json
The userContext.xsjs is in the below code snippet and is called in the App Controller.js
/*eslint no-console: 0, no-unused-vars: 0, dot-notation: 0, no-use-before-define: 0, no-redeclare: 0*/
"use strict";
var oConn = $.hdb.getConnection();
try {
// Initialize hana connection/context
var oSession = $.session;
var body = JSON.stringify($.session);
$.response.contentType = "application/json";
$.response.setBody(body);
$.response.status = $.net.http.OK;
oConn.close();
} catch(ex) {
// Return error
$.response.setBody("Failed to retrieve data");
$.response.status = $.net.http.INTERNAL_SERVER_ERROR;
}
The UI5 app in the XSA cockpit is bound to UAA .I am able to see the scopes and Roles in XSA cockpit. The roles are assigned to a Role Collection and the Role collection is assigned to the user.
When userContext.xsjs is called through UI5, its not returning anything for securityContext.
$.session is retruning user and language but not security Context ..Do I need to do anything else to return scopes from securityContext?
User | Count |
---|---|
68 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.