我无法获取响应授权响应
对于我的测试,我使用Visual Studio控制台。
我在监听程序启动时放了一个端口
// create a redirect URI using an available port on the loopback address.
string redirectUri = string.Format("https://192.168.1.12:7890/");
Console.WriteLine("redirect URI: " + redirectUri);
// create an HttpListener to listen for requests on that redirect URI.
var http = new HttpListener();
http.Prefixes.Add(redirectUri);
Console.WriteLine("Listening..");
http.Start();
var options = new OidcClientOptions
{
Authority = "https://Authority.be/",
Flow = OidcClientOptions.AuthenticationFlow.AuthorizationCode,
ClientId = "password",
ResponseMode = OidcClientOptions.AuthorizeResponseMode.Redirect,
Scope = "openid profile",
RedirectUri = redirectUri,
ProviderInformation = new ProviderInformation
{
IssuerName = "https://Authority.be",
AuthorizeEndpoint = "https://Authority.be/oidc/authorization",
TokenEndpoint = "https://Authority.be/oidc/token",
KeySet = new JsonWebKeySet("{\"alg\":\"RS256\"}")
}
};
var client = new OidcClient(options);
var state = await client.PrepareLoginAsync();
Console.WriteLine($"Start URL: {state.StartUrl}");
// open system browser to start authentication
Process.Start(state.StartUrl);
// wait for the authorization response.
HttpListenerContext context = await http.GetContextAsync();
我在==>上下文中什么也没恢复
我不去下一个指令,为什么?
在浏览器中:
你能帮我吗?
预先感谢