WSO2 API Manager - 我可以在公共商店中隐藏租户商店吗? [英] WSO2 API Manager - Can I hide tenant stores in the public store?

查看:11
本文介绍了WSO2 API Manager - 我可以在公共商店中隐藏租户商店吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以隐藏租户商店,以便它们在公共商店中不可见,而只能通过其直接租户特定商店 URL 显示(例如:https://api.mydomain.com/store/?tenant=mycustomer.com)?

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)?

背景信息:我们所有的客户都在 WSO2 API 管理器中拥有自己的租户.当匿名/未经身份验证的访问者打开公共商店时 (https://api.mydomain.com/store)他/她将看到所有租户商店及其域名.所以发现我们所有客户的名字并不难.这是不可取的.我知道公共商店应该推广公共 API,但我们不提供公共 API(目前).

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).

推荐答案

是的,这是可能的.首先,您必须将 api 管理器配置为使用 SAML2 进行单点登录请参阅此以获取有关 使用 SAML2 进行单点登录

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) 如果您已经有一个子主题,那么您可以使用它,否则您可以在目录 AM_HOME/repository/deployment/server/jaggeryapps/store/site/themes/fancy/subthemes 目录下创建子主题.

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) 并将 template.jag 从 AM_HOME/repository/deployment/server/jaggeryapps/store/site/themes/fancy/templates/menu/primary/template.jag 复制到 AM_HOME/repository/deployment/server/jaggeryapps/store/site/themes/fancy/subthemes//templates/menu/primary/template.jag(请注意,在此期间您可能需要创建目标路径中提到的子目录).然后请复制下面的代码

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) 将下面给出的代码块复制到我们在步骤 2 中创建的 template.jag 页面的顶部.

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) 进入 AM_HOME/repository/deployment/server/jaggeryapps/store/site/conf/site.json 文件,然后添加如下所示的子主题.

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>" } 

现在启动服务器并到 https://localhost:9443/store 然后您将收到登录提示弹出.

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

这篇关于WSO2 API Manager - 我可以在公共商店中隐藏租户商店吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆