我正在尝试将租户 ID 作为参数传递给 identityserver4 隐式授权端点。客户端是使用 angularjs 编写的,是否有任何示例可以将租户 ID 从 Angular 应用程序传递到 identityserver4 端点。
我发现这个特性是使用 acr_values 实现的。更多细节在这里 - https://github.com/IdentityServer/IdentityServer3/issues/348
我正在尝试将租户 ID 作为参数传递给 identityserver4 隐式授权端点。客户端是使用 angularjs 编写的,是否有任何示例可以将租户 ID 从 Angular 应用程序传递到 identityserver4 端点。
我发现这个特性是使用 acr_values 实现的。更多细节在这里 - https://github.com/IdentityServer/IdentityServer3/issues/348
是的当然。您始终可以在 AUth 请求的状态变量中传递用户 ID 或任何其他变量。如果在将请求 URL 发送到 Auth 服务器时将 userID 作为参数包含在请求 URL 中,它将返回重定向 URI 的状态。这意味着您可以在那里访问它。问题是当发送隐式请求时,它实际上将您的应用程序与服务器分离,因为响应 URI(可能)处于不同的状态/页面。因此,通过将其作为状态传递,授权服务器在将用户代理重定向回客户端时包含此值。
public Authenticationrequest() {
var client_id = "YOUR-CLIENT-ID";
var scope = "OPTIONAL";
var redirect_uri = "YOUR_REDIRECT_URI";
var response_type = "token";
var authserver = "YOUR-AUTH-SERVER-URL?";
var state = "OPTIONAL"; // put UserID here
var AuthenticationURL = authserver + "response_type=" + response_type + "&scope=" + scope + "&client_id=" + client_id + "&state=" + state + "&redirect_uri=" + redirect_uri;
return AuthenticationURL;
};