ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Identityserver4接口说明

2021-03-10 17:30:28  阅读:380  来源: 互联网

标签:code supported 接口 说明 token connect https identityserver Identityserver4


目录

Identityserver4 接口说明

发现端点

Url:
/.well-known/openid-configuration

字段说明示例
issuer发行网址,也就是说我们的权限验证站点https://demo.identityserver.io
jwks_uri这个接口获取的是公钥,用于验证jwt的数字签名部分(数字签名由sso维护的私钥生成)用的https://demo.identityserver.io/.well-known/openid-configuration/jwks
authorization_endpoint授权服务器的授权端点的URLhttps://demo.identityserver.io/connect/authorize
token_endpoint获取token的网址https://demo.identityserver.io/connect/token
userinfo_endpoint根据token获取用户信息https://demo.identityserver.io/connect/userinfo
end_session_endpoint登录注销https://demo.identityserver.io/connect/endsession
check_session_iframe客户端对check_session_iframe执行监视,可以获取用户的登出状态https://demo.identityserver.io/connect/checksession
revocation_endpoint这个网址允许撤销访问令牌(仅access tokens 和reference tokens)。它实现了令牌撤销规范(RFC 7009)https://demo.identityserver.io/connect/revocation
introspection_endpointintrospection_endpoint是RFC 7662的实现。 它可以用于验证reference tokens(或如果消费者不支持适当的JWT或加密库,则JWTs)。https://demo.identityserver.io/connect/introspect
device_authorization_endpoint设备授权网址https://demo.identityserver.io/connect/deviceauthorization
frontchannel_logout_supported可选。基于前端的注销机制true
frontchannel_logout_session_supported可选。基于session的注销机制true
backchannel_logout_supported指示OP支持后端通道注销true
backchannel_logout_session_supported可选的。指定RP是否需要在注销令牌中包含sid(session ID)声明,以在使用backchannel_logout_uri时用OP标识RP会话。如果省略,默认值为falsetrue
scopes_supported支持的范围[“openid”, “profile”, “email”, “api”, “api.scope1”, “api.scope2”, “scope2”, “policyserver.runtime”, “policyserver.management”, “offline_access”]
claims_supported支持的claims[“sub”, “name”, “family_name”, “given_name”, “middle_name”, “nickname”, “preferred_username”, “profile”, “picture”, “website”, “gender”, “birthdate”, “zoneinfo”, “locale”, “updated_at”, “email”, “email_verified”]
grant_types_supported授权类型[“authorization_code”, “client_credentials”, “refresh_token”, “implicit”, “password”, “urn:ietf:params:oauth:grant-type:device_code”]
response_modes_supported支持的响应模式[“form_post”, “query”, “fragment”]
token_endpoint_auth_methods_supportedtoken端点支持的身份验证方式[“client_secret_basic”, “client_secret_post”]
id_token_signing_alg_values_supported支持id token 里alg签名的值[“RS256”]
subject_types_supported[“public”]
code_challenge_methods_supported支持的代码质询方法[“plain”, “S256”]
request_parameter_supported支持的请求参数true

token端点

获取token

请求类型: post 
地址 /connect/token
头部请求标签 CONTENT-TYPE application/x-www-form-urlencoded

请求数据(Body)

参数说明
client_id客户标识符(必填)
client_secret客户端机密,可以在帖子正文中,也可以作为基本身份验证标头使用
grant_type类型 :authorization_code client_credentials password refresh_token urn:ietf:params:oauth:grant-type:device_code
scope一个或多个注册范围。如果未指定,将为所有明确允许的作用域发出令牌
redirect_urigrant_type 为 authorization_code时必填
code授权码。 grant_type 为 authorization_code时必填
code_verifierPKCE证明密钥
username登入名 。grant_type 为 password时必填
password登入密码。grant_type 为 password时必填
acr_values允许传递有关password授权类型的其他与身份验证相关的信息-特殊情况下,identityserver使用以下专有acr_values:idp:name_of_idp 绕过登录/家庭领域屏幕,并将用户直接转发到选定的身份提供者(如果每个客户端配置允许)tenant:name_of_tenant 可用于将租户名称传递给令牌端点
refresh_token刷新令牌。grant_type 为 refresh_token时必填
device_code设备代码。 grant_type 为 urn:ietf:params:oauth:grant-type:device_code时必填

用户信息端点

解析token获取token中用户的信息

请求类型: GET 
地址 /connect/userinfo
头部请求标签 Authorization: Basic xxxyyy

自检端点

用来验证授权的有效性

请求类型: POST 
地址 /connect/introspect
头部请求标签 Authorization: Bearer <access_token>

请求数据(Body)

参数说明
token必填

返回响应
状态码200和有效或无效的令牌示例:

{
    "active": true,
    "sub": "123"
}

未知或过期的令牌将被标记为无效示例:

{
     "active": false,
}

无效的请求将返回400,即未授权的请求401。

参考文献

https://blog.csdn.net/weixin_30536513/article/details/96440353
https://identityserver4.readthedocs.io/en/latest/endpoints/discovery.html

标签:code,supported,接口,说明,token,connect,https,identityserver,Identityserver4
来源: https://blog.csdn.net/Diliges/article/details/114638066

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有