保留查询字符串

时间:2018-07-25 02:06:34

标签: c# query-string identityserver4

我将Identity Server 4与Sitefinity客户端一起使用。我正在使用在查询字符串中传递的自定义值构造一个到安全api的url。 (例如:http://localhost:60876/Sitefinity?code=CfDJ8GIUky)。我试图在重定向到ID4之前捕获代码的值,但是该值消失了。以下是我的通知设置:

Notifications = new OpenIdConnectAuthenticationNotifications()
{
    RedirectToIdentityProvider = n =>
    {
        // trying to intercept the request to catch the query string value!
        return Task.FromResult(0);
    }
}

任何帮助将不胜感激。 谢谢

1 个答案:

答案 0 :(得分:0)

经过两天的研究,这是我想出的

1-我创建了一个可公开访问的端点来捕获查询字符串并保存它

QLabel

2- ChallengeResult接受代码并将其添加到AuthenticationProperties

QPixmap p;
ui->imageLabel->setPixmap(p.scaled(640, 512, Qt::KeepAspectRatio));

3-在中间件RedirectToIdentityProvider中

public ActionResult Index(string code)
{
    return new ChallengeResult("OpenIdConnect", "http://localhost:60876", code);
}

但是词典条目不存在。我想念什么吗?

相关问题