【发布时间】:2020-11-24 10:24:55
【问题描述】:
使client_id 成为password 授权类型的强制参数的正确方法是什么?
使用此请求,我想将 client_id 设为强制值,并让 OAuth2 框架将其与返回到方法 loadClientByClientId 的结果进行比较
curl --location --request POST 'http://localhost:8080/engine/oauth/token' \
--header 'Authorization: Basic YWRtaW46cXdlcnR5' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username=admin' \
--data-urlencode 'password=qwerty' \
--data-urlencode 'client_id=some_value' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'scope=read_profile'
实现这一点的最佳方法是什么?
【问题讨论】:
-
为什么你认为
client_id不是强制性的? -
是的,我同意,我不知道其中 clientId 不是强制性的 Oauth2 的单个实现。像这样很好,因为这没有任何意义
标签: spring-security spring-security-oauth2