OAuth2 | 服务器端点

默认情况下,OAuth2 服务器使用以下端点:

Authorization:/sgc/oauth2/auth

Token: /sgc/oauth2/token

撤销:/sgc/oauth2/revoke (POST) — 依据 RFC 7009 撤销令牌。

Introspection:/sgc/oauth2/introspect(POST)— 根据 RFC 7662 返回令牌元数据。

设备授权: /sgc/oauth2/device(POST)- 按照 RFC 8628 颁发设备代码

设备验证:/sgc/oauth2/device/verify(GET/POST)- 用户验证页面

这意味着,如果您的服务器监听 IP 80.54.41.30、端口 8443,则完整的 OAuth2 端点将为:

Authorization: https://80.54.41.30:8443/sgc/oauth2/auth

Token:https://80.54.41.30:8443/sgc/oauth2/token

吊销: https://80.54.41.30:8443/sgc/oauth2/revoke

自省: https://80.54.41.30:8443/sgc/oauth2/introspect

设备授权: https://80.54.41.30:8443/sgc/oauth2/device

设备验证:https://80.54.41.30:8443/sgc/oauth2/device/verify

这些端点可以轻松修改,只需访问组件的 OAuth2Options 属性并修改授权和令牌 URL 即可。

示例:如果您的端点必须 是

Authorization: https://80.54.41.30:8443/authentication/auth

Token:https://80.54.41.30:8443/authentication/token

使用以下值设置 OAuth2Options 属性:

OAuth2Options.Authorization.URL = /authentication/auth

OAuth2Options.Token.URL = /authentication/token

同样的方法适用于其他端点:

OAuth2Options.Revocation.URL = /authentication/revoke

OAuth2Options.Introspection.URL = /authentication/introspect

OAuth2Options.DeviceAuthorization.URL = /authentication/device

OAuth2Options.DeviceAuthorization.VerificationURL = /authentication/device/verify