API in wso2 identity server 5.7 to get fine grained access control list as a response if we pass role - wso2

I am new to WSO2 identity server. Need some help in getting the role-based access control list.
I have one angular application. In that there is a menu like product list, add product, update product, delete product. Based on the role defined in this application I want to show the menu items to the user. For example, we have roles like admin, manager, user. For the admin-role I have to show all the menu items. For manager-role show add-product, update-product and for the user-role only product-list menu item.
So when the user login into my application based on the user role I want to show the menu list. To authenticate, create users, roles, user role mapping I used SCIM2 APIs of wso2 identity server 5.7.
I tried XACML but not succeeded. Please help me how to get the Role-based ACL.

First get an idea about XACML terms PEP, PDP, PAP, PIP [1][2] might help you. You can think about PEP (Policy Enforcement Point) as per your angular application. In order to communicate with XACML PDP, you can use XACML REST APIs [3]. Regarding writing XACML policies for RBAC, you can have a look already available XACML template authn_role_based_policy_template
[1] https://wso2.com/library/tutorials/2016/02/tutorial-how-to-enable-role-based-access-control-for-wso2-api-manager-using-xacml/
[2] https://wso2.com/library/articles/2013/11/fine-grained-xacml-authoriation-with-pip-points/
[3] https://docs.wso2.com/display/IS570/Using+REST+APIs+via+XACML+to+Manage+Entitlement

Related

Camunda Authorization with Spring Security and JWT

I am using the camunda spring-boot-starter and running the embedded camunda engine.
For Authentication, we are using a JWT token and the user information exists in an outside database. From Camunda docs, what I understood is that, for Camunda Authorization like assigning A User Task to a user, will totally depend on the Camunda Database.
How should I use an outside user authenticated with an external system, for the Authorization purpose in the Camunda? Should I create a copy of the authenticated user in the Camunda Database?
As part of the authentication you can also tell Camunda which groups/roles the user belongs to. For instance as shown in this generic simple Spring Security example: https://github.com/camunda-consulting/code/tree/master/snippets/springboot-security-sso
specifically: https://github.com/camunda-consulting/code/blob/4a609b375c6564838e85a1bde7d70e5a9951ab64/snippets/springboot-security-sso/src/main/java/com/camunda/demo/filter/webapp/SpringSecurityAuthenticationProvider.java#L35
Another mechanism uses a custom identity provider (read-only or writable) as explained here: https://docs.camunda.org/manual/latest/user-guide/process-engine/identity-service/#custom-whitelist-for-user-group-and-tenant-ids
It is correct that the default implementation is the database identity service, which uses the engine database for managing users and groups.
However, this is only the case if no alternative identity service implementation is provided. Camunda also provides an LDAP identity service for an LDAP-based user/group repository and you can of course implement your own.
Once you have an authenticated user and user group information for the user, the detailed functional permissions are linked to these groups as shown here: https://docs.camunda.org/manual/latest/webapps/admin/authorization-management/
You don't have to manage users in Camunda and or to sync with another system. If user's authorizations (groups, roles) should be fetched from another system, then use the SPI mentioned above. Either way you don't need to create the users in the Camunda DB. When a request comes in you may set the user and its roles on the IdentityService. In your subsequent API usage the user id and the authorization will be considered (if auth is enabled). If authorizations are disabled, then you only need the user id, not the groups/roles. If you want to provide neither and handle everything in your custom code, then you can just complete task without the user's Id (but won't have the user info in the audit information).

Wso2is admin REST API Postman collection is available to public

I am trying to create a new interface for wso2is for my specific requirement. I only need some specific functionalities (add user, add roles etc) from wso2, I go through several documentation in wso2 website and find:
this document
this post
but never got a complete documentation.
Is it possible to get the postman collections for the same?
The documentation you have referred to is relevant to the admin services for user and role management. They are implemented using SOAP. But since you have some basic requirements as add user delete user add roles you can use the SCIM2 REST API's[1][2]
[1].https://docs.wso2.com/display/IS570/Using+the+SCIM+2.0+REST+APIs
[2].https://medium.com/#vindulajayawardana/scim-2-0-api-for-wso2-identity-server-5-3-0-fc5dcaad9e44

Hide source code from public view in wso2

Hi I am using WSO2 integrator for my integration projects. I would like to know that, is there a way to hide the source codes deployed in WSO2 as car file.That is, the user should not be allowed to edit the services either in source view or in design view. Also please share the thoughts of customize wso2 itself for the same purpose.
It is possible to create users and assign different permission for users in ESB. You can see in the following documentation how to add users and configure roles:
https://docs.wso2.com/display/ADMIN44x/Configuring+Roles
To add a user On the Main tab in the management console, click Add under Users and Roles and follow along.
The following will help to set permissions:
https://docs.wso2.com/display/ADMIN44x/Role-based+Permissions

Multi Tenancy Sign Up option is not available in WSO2 API Manager Store

With respect to WSo2 API Manager Store, I have 2 tenants created in Management Console.
I am able to view those tenants in Store but expect carbon tenant, other users doesnt have an option Signup.
I tried this link too but its not working. https://docs.wso2.com/display/AM1100/Customizing+the+API+Store
Can anyone guide me please?
By default, self sign up is disabled for tenants AFAIK. You can enable this by following the below steps.
Login to management console as tenant admin
Go to the registry browser which can be found in the left menu.
Traverse to /_system/governance/apimgt/applicationdata/sign-up-config.xml file.
Change to true.
After that, go to the api store and you should see the sign up button.

WSO API Manager tutorial

I am trying to create and publish a new API, but at the end of the creation of an API I don't have the button "save and publish" I just have "save" so my API is correctly created but not published. Is there anyone who can help me for doing that?
Thanks a lot
I think the logged in user does not have relevant permissions to publish the api. See https://docs.wso2.com/display/AM1100/Adding+User+Roles for relevant user roles for each type of user level and check whether the logged in user has the permissions related to 'publisher' role. If user does not have the publisher permission, he only can create the api.