Hi guys,
I did play around with the npm module passport and was able to define several restrictions to my services. I'm wondering if it is possible to invoke authentication by the browser while the app is running?
If I use the restrictions for a service (code below) the browser immediately wants me to log-in when I start the app. Furthermore it is not possible to switch users and I have to delete the browser data or use a private session in order that the browser is not saving the log-in data.
@path:'/manage'
service SelfService @(requires: 'admin'){
entity People as projection on plt.People;
}
//Problem: When start the app fiori wants the user to log-in
//Desired: The app asks for a logon when the action is triggered
annotate SelfService.People with @(restrict:[
{grant:['UPDATE', 'DELETE'], to: 'admin'}
]) ;
However; if I restrict the service in the 'service.js' file the browser do not wants me to log-in and just denies the action due to the wrong user role.
srv.before(['UPDATE'], 'People', async req => {
req.user.is('admin') || req.reject(403, "you don't have the rights to update somebody")
})
Is there a possibility to change the user while the app is running?
How would I deal with users and authorizations restrictions if I deploy the app?
Cheers,
Thorsten