PingFederate OAuth 使用 Apache Integration Kit 验证访问令牌

PingFederate OAuth validate access token using Apache Integration Kit

我们正在使用 Apache 集成工具包 (modpf) 将 Web 应用程序与 PingFederate 作为 SP 集成。我们也想使用 PingFederate 作为 OAuth 服务器。我们可以使用相同的集成工具包来验证 OAuth 服务器生成的访问令牌吗? 要么 还有其他图书馆可以做到吗?

我遇到的一个这样的库是 mod_auth_openidc。有人用它来验证访问令牌吗?

您不能使用 Apache 集成工具包 (OpenToken) 来验证 Oauth 令牌。它们是完全不同的令牌类型和格式。

但是,Hans Zandbelt(来自 Ping Identity)实际上写了 mod_auth_openidc 你 link 并根据其描述,它执行以下操作:

"It can also function as an OAuth 2.0 Resource Server, validating access tokens presented by OAuth 2.0 clients against an OAuth 2.0 Authorization Server."

mod_auth_openidc也可以用来为基于OpenID Connect的Apache网站提供单点登录,从而替代mod_pf提供基于OpenToken格式和协议单点登录的模块。执行这两项操作的示例配置:

OIDCProviderMetadataURL https://localhost:9031/.well-known/openid-configuration

OIDCSSLValidateServer Off
OIDCClientID ac_oic_client
OIDCClientSecret abc123DEFghijklmnop4567rstuvwxyzZYXWUT8910SRQPOnmlijhoauthplaygroundapplication

OIDCRedirectURI https://localhost/example/redirect_uri/
OIDCCryptoPassphrase <password>

OIDCOAuthIntrospectionEndpoint https://localhost:9031/as/token.oauth2
OIDCOAuthIntrospectionEndpointParams grant_type=urn%3Apingidentity.com%3Aoauth2%3Agrant_type%3Avalidate_bearer
OIDCOAuthIntrospectionEndpointAuth client_secret_basic
OIDCOAuthRemoteUserClaim Username

OIDCOAuthSSLValidateServer Off
OIDCOAuthClientID rs_client
OIDCOAuthClientSecret 2Federate

<Location /example/>
   AuthType openid-connect
   Require valid-user
</Location>

<Location /api>
   AuthType oauth20
   Require claim scope~\bprofile\b
</Location>

针对您的问题"Are there any other libraries to do it?"。我的意思是,除了 mod_auth_openidc 之外还有什么其他的吗?还有另一种选择。 OAuth 是 PingFederate OAuth 授权服务器 (OAS) 的 RESTful 服务。如果您只想验证传入的访问令牌,那么您可以创建对 PingFederate OAS 的 REST API 调用来验证令牌。在 PingFederate 中,您需要配置 OAuth 客户端以进行验证。您可以将 cURL 集成到 REST 客户端的应用程序中,然后调用 PingFederate OAS。您必须根据您的应用程序或服务要求处理响应。

您可能需要查看 PingAccess 以了解此需求。它与 PingFederate 一起处理浏览器 SSO 和 OAuth 访问令牌验证用例,这可能会简化您的部署。

它优于 Apache 模块,因为它允许集中管理访问控制策略和跨不同应用程序集中注销,这是企业环境中的典型要求。