In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "how to upgrade the permissions of the rest interface", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to upgrade the permissions of the rest interface.
Brief introduction
In addition to using the system's default interface authentication, Rest service processing allows permissions to be refined into each application, that is, each application can customize the interfaces it exposes to the outside world.
prerequisite
Platform: LinkeyBPM (Application process Development platform)
Version: 129.5 or integrate the latest Rest interface service
Create an interface authentication rule
Publish authentication interface
Suppose the published interface id is: getLoginToken, and the interface url address is: / rest/ws/g/AABBCCDD/getLoginToken
Application configuration authentication interface
The only id of the application configuration is tokenUrlId, and the configuration value is the publishing API getLoginToken.
Package cn.linkey.itemp;//package cn.linkey.rulelib.AABBCCDD;import java.util.Date;import java.util.HashMap;import cn.linkey.factory.BeanCtx;import cn.linkey.rest.RestUtil;import cn.linkey.rule.LinkeyRule;import cn.linkey.util.Tools / * * @ RuleName: used for API authentication * @ author admin * @ Created: 2019-11-05 16:54:01 * / final public class R_AABBCCDD_B001 implements LinkeyRule {@ Override public String run (HashMap params) throws Exception {/ / params is the parameter / / String userid = BeanCtx.getRequest (). GetHeader ("userId") passed when running this rule. String userId = BeanCtx.g ("userId"); String password = BeanCtx.g ("password"); String jsonStr = ""; BeanCtx.out ("token for custom application authentication") If (RestUtil.checkuserpwd (userId, password)) {jsonStr = "{\" token\ ":\" + Tools.base64 (userId + "#" + new Date (). GetTime ()) + "\"} "; jsonStr = RestUtil.returnLinkeyData (" 1 "," Application Certification Test ", jsonStr) } else {jsonStr = RestUtil.returnLinkeyData ("0", "wrong username or password", jsonStr);} return jsonStr;}} effect test
At this point, I believe you have a deeper understanding of "how to upgrade the rest interface permissions". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.