Skip to Content
0
Aug 03, 2023 at 09:37 PM

Authentication, roles and security deployed application sapui5

271 Views Last edit Aug 11, 2023 at 08:25 AM 2 rev

Hello experts, I have just deployed my sapui5 application through the mta, at this moment I can log in and enter the application. What I need to finish the project is to obtain the data of the logged in user, which is name, role and so on. the role allow or deny access to certain parts of the application which I am managing through a nav container. I don't know much about authentication and security, but I want this to be based only on the client side. this is my xs-security.json file

{<br>  "xsappname": "evaluatorweb",<br>  "tenant-mode": "dedicated",<br>  "description": "Security profile of called application",<br>  "scopes": [<br>    {<br>      "name": "uaa.user",<br>      "description": "UAA"<br>    },<br>    {<br>      "name": "evaluatorweb.read",<br>      "description": "read access"<br>    },<br>    {<br>      "name": "evaluatorweb.write",<br>      "description": "write access"<br>    }<br>  ],<br>  "role-templates": [<br>    {<br>      "name": "Token_Exchange",<br>      "description": "UAA",<br>      "scope-references": [<br>        "uaa.user"<br>      ]<br>    },<br>    {<br>      "name": "Evaluador",<br>      "description": "Role for Evaluators",<br>      "scope-references": [<br>        "evaluatorweb.read",<br>        "evaluatorweb.write"<br>      ]<br>    },<br>    {<br>      "name": "Colaborador",<br>      "description": "Role for Collaborators",<br>      "scope-references": [<br>        "evaluatorweb.read",<br>        "evaluatorweb.write"<br>      ]<br>    },<br>    {<br>      "name": "Talento_Humano",<br>      "description": "Role for Human Talent",<br>      "scope-references": [<br>        "evaluatorweb.read",<br>        "evaluatorweb.write"<br>      ]<br>    }<br>  ]<br>}

and this is my xs-app.json

{<br>  "welcomeFile": "/index.html",<br>  "authenticationMethod": "route",<br>  "routes": [<br>    {<br>      "source": "^/v2/(.*)$",<br>      "target": "/v2/$1",<br>      "destination": "DestIngenio",<br>      "authenticationType": "xsuaa",<br>      "csrfProtection": false<br>    },<br>    {<br>      "source": "^/resources/(.*)$",<br>      "target": "/resources/$1",<br>      "authenticationType": "none",<br>      "destination": "ui5"<br>    },<br>    {<br>      "source": "^/test-resources/(.*)$",<br>      "target": "/test-resources/$1",<br>      "authenticationType": "none",<br>      "destination": "ui5"<br>    },<br>    {<br>      "source": "^(.*)$",<br>      "target": "$1",<br>      "service": "html5-apps-repo-rt",<br>      "authenticationType": "xsuaa"<br>    }<br>  ]<br>}