rest - Is returning different output based on authentication credentials RESTful? -
I have a REST API which allows the developer to fetch a certain resource:
< Code> / API / Project / API / Project / 4 ...The API requires authentication. Authentication token has been added to the HTTP header.
Is a different output to be returned based on that user?
Thank you!
REST does not define anything in that regard
Should keep independent authentication logic and authorization logic.
There are really requirements, from which you want to change the changes returned based on various characteristics / standards such as:
Authentication type Time User Location Device type ... You can get it by using a filter in front of your REST service Filters / Interceptors are explained.
Then you can send an authorization request at a decision point which determines what can be returned based on the identity of the user (or other characteristics).
For example, if you can argue to return a project to a user, if and if they are related to the same area, the endpoint of the other will still be / API / project but the content returned is authZ logic Will vary on the basis of Take a look at XACML and ALFA to apply that layer.
HH
Comments
Post a Comment