更新时间:2023-02-16 21:36:06
将此行添加到MVC客户端的AddOpenIdConnect选项中,以请求身份令牌和访问令牌:
Add this line to your MVC client's AddOpenIdConnect options to request an identity token and access token:
options.ResponseType = "id_token token";
您的JS客户端要求一个身份令牌和一个访问令牌,而MVC客户端仅要求一个身份令牌和资源身份令牌中不允许使用范围.请参见 http://docs.identityserver.io/en/release/endpoints/authorize .html :
Your JS client is asking for an identity token and an access token whereas the MVC client is only asking for an identity token and resource scopes are not allowed in identity tokens. See http://docs.identityserver.io/en/release/endpoints/authorize.html:
id_token请求一个身份令牌(仅允许身份范围)
id_token requests an identity token (only identity scopes are allowed)
令牌请求访问令牌(仅允许资源作用域)
token requests an access token (only resource scopes are allowed)