本文介绍了oAuth2 - WSO2 API 管理器和身份服务器集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现一个基于 oAuth2 的架构,其中令牌由 WSO2 身份服务器(Auth Server)生成,API 管理器用作网关(资源服务器).

I would like to implement an architecture based on oAuth2 in which the token is generated by the WSO2 identity server (Auth Server) and the API manager is used as the Gateway (resource server).

我知道有必要更改 Identity_Server/repository/conf/carbon.xml 并为元素 <HideAdminServiceWSDLs>false</HideAdminServiceWSDLs> 设置值 false为了启用身份服务器公开的令牌验证管理服务.此外,我认为有必要配置 APIManager.xml 以配置 API 管理器以使用身份服务器公开的服务检查令牌验证.

I understood it's necessary to change the Identity_Server/repository/conf/carbon.xml and set the value false for the element <HideAdminServiceWSDLs>false</HideAdminServiceWSDLs> in order to enable the admin Service of token validation exposed by the Identity Server. Also I think it's necessary to configure the APIManager.xml to configure the API manager to check the token validation using a service exposed by the identity server.

但不幸的是,https://docs 上没有具体的文档.wso2.org/display/AM140/Configuring+api-manager.xm.有人可以帮助我了解如何实现我的目标吗?

But unfortunately the specific documentation is not available at https://docs.wso2.org/display/AM140/Configuring+api-manager.xm. Can someone help me understand how to achieve my goal ?

推荐答案

如果假设您想要的是正确的,请使用 OAuth 保护公开的 rest API,使用 WSO2 IS,那么以下链接 [1] 将帮助您.

If it's correct to assume what you want is to, secure a exposed rest API with OAuth, using WSO2 IS, then the following link [1] will help you.

但由于您使用的是 WSO2 API 管理器,如果没有其他限制,您可以简单地从 API 管理器本身实现此令牌生成功能.API-M 公开了一个 OathTokenEndPoint.您可以使用客户端密钥和机密调用此端点以获取令牌.[2]

But since you are using WSO2 API manager, if there is no other restriction you can simply achieve this token generation functionality from API-manager itself. There is an OathTokenEndPoint exposed by API-M. You can call this endpoint with client-key and secret to get a token.[2]

[1] - http://moveaheadblog.blogspot.com/2014/02/securing-your-web-service-with-oauth2.html

[2] - https://docs.wso2.org/display/IS410/OAuth+2.0+Grant+Types+with+WSO2+API+Manager+Authorization+Code

这篇关于oAuth2 - WSO2 API 管理器和身份服务器集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 19:16