Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Refused to connect. /sign-oidc

$
0
0

In my .NET Blazor application, the after successful authentication using Azure B2C (Azure sign-in log shows 'Success'), the error page is returned with the URL https://localhost: /signin-oidc

Error #1

Error #2

Unfortunately, there are no logs to illuminate the cause of the error.

services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme).AddMicrosoftIdentityWebApp(options =>{    options.RemoteAuthenticationTimeout = TimeSpan.FromSeconds(10);    builder.Configuration.Bind("OpenIDConnect", options);    options.Events = new OpenIdConnectEvents    {        OnRedirectToIdentityProvider = async ctxt =>        {            logger.Info($"On Redirect To Identity Provider : {ctxt.Request.Host.Value}");            await Task.Yield();        },        OnAuthenticationFailed = async ctxt =>        {            logger.Info($"On Authentication Failed");            Console.WriteLine("On Authentication Failed");            await Task.Yield();        },        OnSignedOutCallbackRedirect = async ctxt =>        {            logger.Info($"On Signed Out Callback Redirect");            ctxt.HttpContext.Response.Redirect(ctxt.Options.SignedOutRedirectUri);            ctxt.HandleResponse();            await Task.Yield();        },        OnMessageReceived = async ctxt =>        {            logger.Info($"On Message Received : {ctxt.Request.Path.Value}");        },        OnAuthorizationCodeReceived = async context =>        {            logger.Info("Authorization Code Received");            Console.WriteLine("Authorization Code Received");        },        OnTokenValidated = async context =>        {            logger.Info("Token Validated");            Console.WriteLine("Token Validated");        },        OnRemoteFailure = async ctxt =>        {            logger.Info($"On Remote Failure : {ctxt.Failure?.Message}");            ctxt.Response.Redirect("/");            ctxt.HandleResponse();            Console.WriteLine("On Remote Failure");        },        OnTokenResponseReceived = async ctxt =>        {            logger.Info($"On Access Denied");            Console.WriteLine("OnTokenResponseReceived");        },        OnTicketReceived = async ctxt =>        {            logger.Info($"On Ticket Received : {ctxt.Request.Path.Value}");         }        );

The log records OnRedirectToIdentityProvider event, but there is no logs on OnRemoteFailure or OnTokenResponseReceived.

Could you please advise me on how to resolve this error or log it for reference?

Thanks in advance. Any help appreciated.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>