码迷,mamicode.com
首页 > Windows程序 > 详细

api-gateway实践(12)新服务网关 - 审批产生网关身份!

时间:2017-07-12 12:12:17      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:style   ati   创建   .com   服务   gis   font   types   com   

一、创建网关侧身份

1、client身份(oauth_client_details)

1.1、数据结构

技术分享

技术分享技术分享

1.2、界面代码

 

技术分享

 

<form id="formDto" class="form-horizontal" action="/spring-oauth-server/register_client" method="post">

技术分享

1.3、后台代码

技术分享

技术分享

技术分享

final String sql = " insert into oauth_client_details(client_id,resource_ids,client_secret,scope,authorized_grant_types,web_server_redirect_uri," +
" authorities,access_token_validity,refresh_token_validity,additional_information,trusted,autoapprove) values (?,?,?,?,?,?,?,?,?,?,?,?)";

二、如何创建

1、构建各个参数的值

为相应的http参数赋如下值:

client_id:随机client_id 

resource_ids:‘apigw-resource’ 

client_secret:‘随机密码串‘         

scope:‘[read,write]‘ 

authorized_grant_types:‘client_credentials,refresh_token‘ 

web_server_redirect_uri:‘’

authorities:‘ROLE_APIGW‘ 

access_token_validity:155520000

refresh_token_validity:155520000 

additional_information:‘’

trusted:0

autoapprove:false

2、获取网关地址,拼接上‘/register_client‘, post方式发起http调用(网关地址支持可配置)

api-gateway实践(12)新服务网关 - 审批产生网关身份!

标签:style   ati   创建   .com   服务   gis   font   types   com   

原文地址:http://www.cnblogs.com/lexiaofei/p/7154442.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!