WSO2 API Manager - Can I hide tenant stores in the public store?

╄→尐↘猪︶ㄣ 提交于 2019-12-07 16:39:40

问题


Is it possible to hide tenant stores, so the they aren't visible in the public store, but only by their direct tenant specific store URL (like: https://api.mydomain.com/store/?tenant=mycustomer.com)?

Background info: All our customers get their own tenant in the WSO2 API Manager. When an anonymous/unauthenticated visitor opens the public store (https://api.mydomain.com/store) he/she will see all tenant stores and their domain names. So it isn't really hard to discover the names of all our customers. This is undesirable. I know that the public store is supposed to promote public API's, but we don't offer public API's (yet).


回答1:


yes it is possible. First you have to configure api manager to Single Sign-on with SAML2 Please refer this for more details about Single Sign-on with SAML2

Now you have to do some modification on getting login popup when we access the store, as explained below. We can use the subthemes to achieve this customization. Please follow the below instructions to try out the login popup for the store, but this will take you to the tenant listing page once you logged in.

1) In the case you already have a sub theme, then you can use that else you can create the sub themes under the directory AM_HOME/repository/deployment/server/jaggeryapps/store/site/themes/fancy/subthemes directory.

2) And the copy the template.jag from AM_HOME/repository/deployment/server/jaggeryapps/store/site/themes/fancy/templates/menu/primary/template.jag to AM_HOME/repository/deployment/server/jaggeryapps/store/site/themes/fancy/subthemes//templates/menu/primary/template.jag (Please note during this you may need to create the sub directories as mentioned in the destination path). And then please copy the below code

3) Copy the code block given in below to the top of the template.jag page which we created in the step-2.

<%
include("/jagg/jagg.jag");
var user = jagg.getUser();
var mod,httpUrl,httpsUrl;
mod = jagg.module("manager");
httpsUrl= mod.getHTTPsURL();
var httpsURL = httpsUrl + request.getRequestURI();

if(request.getQueryString())
{ httpsURL += "?" + request.getQueryString(); }

if(!user)
{ session.put("showLogin","true"); }

%> 

4) Go to AM_HOME/repository/deployment/server/jaggeryapps/store/site/conf/site.json file, and then add the subtheme as shown in below.

"theme" :
{ "base" : "fancy", "subtheme" : "<name_of_the_theme>" } 

Now start the server and to https://localhost:9443/store then you will be promt with login popup.



来源:https://stackoverflow.com/questions/32769717/wso2-api-manager-can-i-hide-tenant-stores-in-the-public-store

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!