我们的 OpenID Connect 请求成功,但它缺少必需的参数
Our OpenID Connect request succeeds though it lacks required parameters
我正在使用 Fiddler 向我们的 OpenID Connect Identity Server 发出以下请求。
POST http://localhost:50000/connect/token HTTP/1.1
User-Agent: Fiddler
Host: localhost:50000
Content-Length: 73
Content-Type: application/x-www-form-urlencoded
grant_type=password&username=my_username&password=my_password&nonce=12345
OpenID Connect 身份服务器回复此响应。
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 2136
Content-Type: application/json;charset=UTF-8
Expires: -1
Server: Microsoft-IIS/10.0
X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcQmlnRm9udFxEb2N1bWVudHNcR2l0SHViXEFzcE5ldC5TZWN1cml0eS5PcGVuSWRDb25uZWN0LlNlcnZlclxzYW1wbGVzXFJlc291cmNlT3duZXJQYXNzd29yZEZsb3dcd3d3cm9vdFxjb25uZWN0XHRva2Vu?=
X-Powered-By: ASP.NET
Date: Fri, 26 Jun 2015 17:49:39 GMT
{"token_type":"bearer","access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjA1MkM1RTQyMTVDRDBDMUUxNTA1RTA4RTZBRjNBREJFRkJGRDc4MjIifQ.eyJuYW1laWQiOiJDbGFpbVR5cGVzLk5hbWVJZGVudGlmaWVyIiwidW5pcXVlX25hbWUiOiJKb2huIiwiZmFtaWx5X25hbWUiOiJEb2UiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjUwMDAwLyIsImV4cCI6MTQzNTM0NDU3OSwibmJmIjoxNDM1MzQwOTc5fQ.Yp79C1xpfDb21iR0O7pkuQIrSp539Qf8zWlZGAZveYEs7IEiE9vepK39mMFM5UpVPSgxwtEeig4O1eHSDDJayQEXN1Q1nOqWJtww6I8mlBGmx0YQSQLmV3saTKEhs6Y4VNBe5A9X9xiWURkZhrTRS_SxkztibYZ8XlkcVUQ6OZeDx9OVdXpYl8R3B6deymBDDADWichKrkDhb4lhpOFrU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JDcSTxiGgzikwAOdmBlCc7K6-NCttTjK_ktQEd_sFsAS77Wb8t5g-bZWMJRWuSnQPFhrUyw3HoFXiP2qkFLTRU6alOud9usRB3Tq_UtxVsVanBtqCmsW07puKqiTuOjBhau0jX9GlWfHa1ZsvncgsaHS3FIoHGPaRXyYqABtIUbPUWfRJRoL0OihSm0wLLZPrYSwNVMWRp8Wb6ClOxZtaWxpJmF7BaTDyu3BOjDf-AUIDTVHDDPYtA8SUlWXlPXm6ekeOzGHCA9J8Ri-TRxaAW_LWdn1C2H44W6TLCxGEzsLn53M8IAnMqAEGr6eTCxN6jaffsKhXVlqbtXnSjg9nYsxvKHOPQmmiIRFGpuohoPzNHbxxaurFEabAMLegi21xVTi15RoGs-xtfrnl7x8WH834IlYh6E-D_8rLP0zg81HO8QoKqnEtFZlTfNrZsdGx7lka5IO9MRtiPyVtWQNZN9fJPCASRYngEtQV","expires_in":"3599"}
id_token
包含此信息。
{
nameid: "ClaimTypes.NameIdentifier",
iat: "1435340979",
at_hash: "poDmvMW0mczrXLctK5CdwQ",
nonce: "12345",
sub: "ClaimTypes.NameIdentifier",
iss: "http://localhost:50000/",
exp: 1435342179,
nbf: 1435340979
}
我们暂时使用 ClaimType.NameIdentifier
作为占位符文本。因此,request/response 成功,Identity Server 向依赖方提供 id_token
和 access_token
。
我们的问题是,当我们的请求不满足 OpenID Connect authentication request requirements listed here 时,我们的请求如何才能成功。也就是说,我们正在执行规范似乎未涵盖的用户名密码流程。
我怀疑这只是意味着我们对 OpenID Connect 身份提供程序的实现还不完整。那正确吗?这是怎么回事?
您的 OpenID Connect 提供程序的实现超出了 OpenID Connect 规范中明确指定的范围。 OpenID Connect 中没有定义明确的资源所有者密码凭证授权,但实现可能会从 OAuth 2.0 继承该授权。如果它在 OpenID Connect 中被标准化,它肯定需要 scope
和 openid
以及 client_id
。
所以这是 OpenID Connect 的非标准扩展授权实现。尽管如果它支持核心 OpenID Connect 规范的必需元素,实现可能仍然是完整的。
请注意,资源所有者密码凭据授予破坏了联合 SSO 协议的要点,即依赖方无法查看或处理用户凭据。这就是为什么它没有在 OpenID Connect 中标准化并且仅是 OAuth 2.0 "for migration purposes" 的一部分。
我正在使用 Fiddler 向我们的 OpenID Connect Identity Server 发出以下请求。
POST http://localhost:50000/connect/token HTTP/1.1
User-Agent: Fiddler
Host: localhost:50000
Content-Length: 73
Content-Type: application/x-www-form-urlencoded
grant_type=password&username=my_username&password=my_password&nonce=12345
OpenID Connect 身份服务器回复此响应。
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 2136
Content-Type: application/json;charset=UTF-8
Expires: -1
Server: Microsoft-IIS/10.0
X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcQmlnRm9udFxEb2N1bWVudHNcR2l0SHViXEFzcE5ldC5TZWN1cml0eS5PcGVuSWRDb25uZWN0LlNlcnZlclxzYW1wbGVzXFJlc291cmNlT3duZXJQYXNzd29yZEZsb3dcd3d3cm9vdFxjb25uZWN0XHRva2Vu?=
X-Powered-By: ASP.NET
Date: Fri, 26 Jun 2015 17:49:39 GMT
{"token_type":"bearer","access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjA1MkM1RTQyMTVDRDBDMUUxNTA1RTA4RTZBRjNBREJFRkJGRDc4MjIifQ.eyJuYW1laWQiOiJDbGFpbVR5cGVzLk5hbWVJZGVudGlmaWVyIiwidW5pcXVlX25hbWUiOiJKb2huIiwiZmFtaWx5X25hbWUiOiJEb2UiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjUwMDAwLyIsImV4cCI6MTQzNTM0NDU3OSwibmJmIjoxNDM1MzQwOTc5fQ.Yp79C1xpfDb21iR0O7pkuQIrSp539Qf8zWlZGAZveYEs7IEiE9vepK39mMFM5UpVPSgxwtEeig4O1eHSDDJayQEXN1Q1nOqWJtww6I8mlBGmx0YQSQLmV3saTKEhs6Y4VNBe5A9X9xiWURkZhrTRS_SxkztibYZ8XlkcVUQ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4kd5XQJX6bLD3XnPlPs8Fn0n1e-b1RVlQ8NW56bHrJDcSTxiGgzikwAOdmBlCc7K6-NCttTjK_ktQEd_sFsAS77Wb8t5g-bZWMJRWuSnQPFhrUyw3HoFXiP2qkFLTRU6alOud9usRB3Tq_UtxVsVanBtqCmsW07puKqiTuOjBhau0jX9GlWfHa1ZsvncgsaHS3FIoHGPaRXyYqABtIUbPUWfRJRoL0OihSm0wLLZPrYSwNVMWRp8Wb6ClOxZtaWxpJmF7BaTDyu3BOjDf-AUIDTVHDDPYtA8SUlWXlPXm6ekeOzGHCA9J8Ri-TRxaAW_LWdn1C2H44W6TLCxGEzsLn53M8IAnMqAEGr6eTCxN6jaffsKhXVlqbtXnSjg9nYsxvKHOPQmmiIRFGpuohoPzNHbxxaurFEabAMLegi21xVTi15RoGs-xtfrnl7x8WH834IlYh6E-D_8rLP0zg81HO8QoKqnEtFZlTfNrZsdGx7lka5IO9MRtiPyVtWQNZN9fJPCASRYngEtQV","expires_in":"3599"}
id_token
包含此信息。
{
nameid: "ClaimTypes.NameIdentifier",
iat: "1435340979",
at_hash: "poDmvMW0mczrXLctK5CdwQ",
nonce: "12345",
sub: "ClaimTypes.NameIdentifier",
iss: "http://localhost:50000/",
exp: 1435342179,
nbf: 1435340979
}
我们暂时使用 ClaimType.NameIdentifier
作为占位符文本。因此,request/response 成功,Identity Server 向依赖方提供 id_token
和 access_token
。
我们的问题是,当我们的请求不满足 OpenID Connect authentication request requirements listed here 时,我们的请求如何才能成功。也就是说,我们正在执行规范似乎未涵盖的用户名密码流程。
我怀疑这只是意味着我们对 OpenID Connect 身份提供程序的实现还不完整。那正确吗?这是怎么回事?
您的 OpenID Connect 提供程序的实现超出了 OpenID Connect 规范中明确指定的范围。 OpenID Connect 中没有定义明确的资源所有者密码凭证授权,但实现可能会从 OAuth 2.0 继承该授权。如果它在 OpenID Connect 中被标准化,它肯定需要 scope
和 openid
以及 client_id
。
所以这是 OpenID Connect 的非标准扩展授权实现。尽管如果它支持核心 OpenID Connect 规范的必需元素,实现可能仍然是完整的。
请注意,资源所有者密码凭据授予破坏了联合 SSO 协议的要点,即依赖方无法查看或处理用户凭据。这就是为什么它没有在 OpenID Connect 中标准化并且仅是 OAuth 2.0 "for migration purposes" 的一部分。