我正在尝试使用 App ID 对通过 CLI 工具在 Kubernetes 中运行的服务进行用户身份验证/授权。
我已经配置了 App ID 并配置了 SAML 身份提供者。我添加了一个应用程序并获得了租户 ID、客户端 ID 和客户端密码。我还在appid-auth
Kubernetes 入口定义中添加了注释。
根据这里的文档https://cloud.ibm.com/docs/services/appid?topic=appid-obtain-tokens,它应该通过 curl 非常困难,但我得到Error - cloud directory is OFF
.
这是一个带有 X'd 凭据的示例。
$ curl -iX POST \
> https://us-south.appid.cloud.ibm.com/oauth/v4/XXXX/token \
> -H 'Authorization: Basic XXXXXXXXX' \
> -H 'Content-Type: application/json' \
> -H 'Accept: application/json' \
> -d '{"grant_type":"password","username":"testuser@ibm.com","password":"testuser"}'
HTTP/2 403
date: Tue, 04 Jun 2019 17:20:54 GMT
content-type: text/html; charset=utf-8
set-cookie: __cfduid=d8fb55f6b30555b81f64b3c3e40bbf8f71559668853; expires=Wed, 03-Jun-20 17:20:53 GMT; path=/; domain=.us-south.appid.cloud.ibm.com; HttpOnly
x-dns-prefetch-control: off
x-frame-options: SAMEORIGIN
strict-transport-security: max-age=15552000; includeSubDomains
x-download-options: noopen
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
surrogate-control: no-store
cache-control: no-store, no-cache, must-revalidate, proxy-revalidate
pragma: no-cache
expires: 0
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 4e1b948028aec1cf-IAD
Error - cloud directory is OFF
如果我使用"grant_type":"client_credentials"
,它会返回获取访问令牌,但我需要一个身份令牌,以便应用程序可以根据用户进行授权。
我已经尝试在入口定义中使用“网络”版本,并且网络重定向工作正常。所以我知道 SAML 配置正确。