Created by Jerry Wang, last modified on Dec 26, 2014
假设gateway system A,使用user a 连backend system1, 使用user b连backend system 2:
只需用Chrome 插件Postman,在Meta data request url里加上如下的http header:

Authorization的value是user:password的base64编码, 可通过如下的Java code获取:(需要library commons-codec.jar )
String content = "user:password";
byte[] authEncBytes = Base64.encodeBase64(content.getBytes());
String result = new String(authEncBytes);
System.out.println("Basic " + result);

注: 每次切换user的Authorization value后需重启浏览器。
| 留言与评论(共有 0 条评论) |