Dynamic WSO2 API manager store theme change - wso2-api-manager

I need to change WSO2 API manager store theme dynamically based on the inbound request.
For example customer1 should be able to access store with theme specific to customer1.
customer2 should be able to access store with theme specific to customer2.
Is it possible with WSO2 APIM ?

As of now, The API Store theme cannot be changed according to the user who login in. The theme is applied node wise. If you have a clustered/multiple store setup you can have different themese for each API store.
https://docs.wso2.com/display/AM250/Adding+a+New+API+Store+Theme

Related

WSO2 Carbon - custom mediators in common policies

where i can find in Carbon option to upload my own mediators inside common policies, so its possible to choose from these menu bar and its not necessary to upload file into custom policies in publisher ?
Thanks !
Follow the below steps to upload your custom policies as common policies in WSO2 API Manager
Construct your mediation policy and save it with proper naming convention and extension
Navigate to the Carbon Management console of the API Manager server (https://localhost:9443/carbon) and log in with Admin credentials
Expand Resources accordion and click on Browse
Go to /_system/governance/apimgt/customsequences path and choose either in, or out, or fault Resource Collection based on where your mediation policy wants to be listed
Click on Add Resource and upload the content
Method: Upload from content
File: Upload the mediation policy file
Click on Add
Once the above steps are executed successfully, you can log in to the Publisher portal and select the custom mediation policy from the Common Policies section.

How to disable create account feature on wso2 admin portal

I want to disable the create account feature on the WSO2 admin portal.
Come across this solution which says there is a way to hide the button by editing particular frontend view.
Is there any other workaround to disable that button and let only administrators to create user accounts without interfering frontend?
I mean can I get the desired result by editing some configuration files or some components in carbon portal?
If you want to completely disable the self-sign-up feature you can follow [1]. This will disable the feature for the tenant of the user who has logged into the carbon management console and disabled this feature. If you want to restrict this feature to particular users then you can add a self-sign-up workflow and accept/reject the self-sign-up request [2].
[1] https://apim.docs.wso2.com/en/latest/reference/customize-product/customizations/customizing-the-developer-portal/enabling-or-disabling-self-signup/#disabling-self-signup
[2] https://apim.docs.wso2.com/en/latest/reference/customize-product/customizations/adding-a-user-signup-workflow/
You can add this to your deployment.toml file, I found it more effective than the official documentation.
[identity_mgt.endpoint]
enable_self_signup_endpoint=false

How do I make certain endpoints of the woocommerce rest api authless?

The Woocommerce rest API requires authentication through a consumer key and a consumer secret to access any of its endpoints. I'm currently building a store frontend using Nuxt js and Vue and I really want to use the Woocoomerce API as a backend restful API to power my store - (get products, categories and the like).
Unfortunately I can't simply pass the consumer key and secret through my frontend to access woocommerce as it will give the frontend client full control over woocommerce so anyone who opens devtools and checks the secret and key can call wocommerce on sensitive endpoints I didn't intend it for.
There is a plugin called Public Woo API solves some of this problem but doesn't work for all endpoint I need (most expecially order). The only obvious solution I can think of is a way to remove authentication for some endpoints.
How do I even do that? I don't even know where to begin. Thanks.

woocommerce rest API request for purchase single product

New to woocommerce ,i develop a sale file app , i decide to use woocommerce rest API i can show products
/wc-api/v2/products
I know how can add to order
/wc-api/v2/orders
How can add product to cart and checkout and connect to bank gateway?
The cart is part of a session and is saved in the MySQL table wp_woocommerce_sessions. This table is accessed using a WC_Session_Handler object. AFAIK the WooCommerce REST API does not provide access to WC_Session_Handler objects.
I don't understand exactly what you are trying to do but if you want to access the cart through the REST API I think you will need to implement your own REST controller for the wp_woocommerce_sessions table. This isn't that difficult to do as you can modify one of the existing WooCommerce REST controllers to work with WC_Session_Handler objects to access the wp_woocommerce_sessions table.
But, beware a WooCommerce session is bound to a browser session through cookies and you need to handle that binding.

In wso2 api cloud is it possible to add custom sequence for manipulating request and response to/from back end service

From my understanding of the regular WSO2 API Manager product I could create multiple synapse-configurations and register them as (global or api specific) sequences by placing them in the proper directory.
I would then utilize the Sequence configuration capabilites on the "Manage screen" to apply different sequences to the request and response payloads of the backend.
I read the documentation at https://docs.wso2.com/display/APICloud/Key+Concepts#KeyConcepts-Sequences as it is not possible to add more but I wanted to ask specifically.
Is it at all possible to do this type of manipulation in the current version of public API cloud?
I have talked with the relevant teams and this is how you can add a sequence in the API Cloud. Although I mentioned about adding a sequence via the Gateway's carbon console (and said it was broken), WSO2 API Manager product is not a position to make it working (this is a known limitation). If I explain the reason in simple terms, to support it they will need to ship a lot of mediator UIs which will make the product similar to the WSO2 ESB. Following is what you can do.
Use WSO2 Developer Studio to create the sequence you want.https://docs.wso2.com/display/DVS371/Creating+ESB+Artifacts#CreatingESBArtifacts-Workingwithsequences
Go to API Gateway at https://gateway.api.cloud.wso2.com/carbon
You need to login to the gateway. Username is email#tenantDomain. If your email abc#gmail.com and tenant domain (or the organisation key is xyz) you need to give abc.gmail.com#xyz as the username (note the # in the email being replaced with a DOT). Go to "Manage" in the top level menu of API Cloud and you will be able to figure out your organisation key.
Go to Resources -> Browse menu and navigate to /_system/governance/apimgt/customsequences/ registry path. Upload your sequence to in, out or fault folders based on your requirement. This will be then available when you create APIs via the API Publisher.
Yes, it is possible. You have to follow the below steps.
Go to API Gateway at https://gateway.api.cloud.wso2.com/carbon
You need to login to the gateway. Username is email#tenantDomain. If your email abc#gmail.com and tenant domain (or the organisation key is xyz) you need to give abc.gmail.com#xyz as the username (note the # in the email being replaced with a DOT). Go to "Manage" in the top level menu of API Cloud and you will be able to figure out your organisation key.
After login, you can go to sequence menu and add a sequence. I tried these steps just now and realised there is a broken page at add sequence. We are in the process of fixing it. Will keep you updated.
Difference of API Cloud and API Manager standalone version is, you have to store the sequence in the registry for it to be available at the API Publishing time.
We'll be adding a doc on this at the following location soon.
https://docs.wso2.com/display/APICloud/About+WSO2+API+Cloud#AboutWSO2APICloud-CommonAPICloudusecases

Resources