Redirected to the login page again and again

Hey.. Bhushan this side. I am new to radzen Blazor. Currently I am working on the project where the user tries to login, it gets redirected to the login page again even the login credentials are correct. I have Blazor WASM project. But when I redirected to the unauthorized page after login then the user gets the access to the authenticated pages.
This issue occurs on server.
If I run my project locally then the user gets logged in successfully.

while login I have observed that in my developer tool of browser I get 302 code for redirect page. But for local I get the 200 code, then redirected to my home page.


this is my server

this is my local

Hi @Bhushan_Harpade,

You can check the troubleshooting instructions here. The lack of HTTPS certificate is what usually causes such problems.

Hi @korchev,
I have checked the troubleshooting instructions. The SSL certificate is valid and configured correctly.
Then also I am facing the issue

Hi @Bhushan_Harpade,

If you have an active subscription you can send us an URL to your live application to info@radzen.com and we can check it out further.

If not I suggest adding logging code in the GetAuthenticationStateAsync method of SecurityService to see if there are any exceptions being thrown.

Hi @korchev

I have applied the logging code in GetAuthenticationStateAsync method of SecurityService and below are the exceptions i get. I have seen this exceptions at log file

GetAuthenticationStateAsync: Exception occurred while getting authentication state.

Exception:
System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)

Hi @Bhushan_Harpade,

What is the server you have deployed to?

I have deployed on "IIS 10.0" & ".Net CLR Version 4.0"

I am also getting the below exception in logs:-

RequestPath: /Login

There was an error executing a callback while pausing the application.

Exception:
System.ArgumentException: There is already a persisted object under the same key 'Theme'
at Microsoft.AspNetCore.Components.PersistentComponentState.PersistAsJson[TValue](String key, TValue instance)
at Radzen.Blazor.RadzenTheme.PersistTheme()
at Microsoft.AspNetCore.Components.Infrastructure.ComponentStatePersistenceManager.g__ExecuteCallback|11_0(Func1 callback, ILogger1 logger)

Unfortunately I am out of further ideas. Getting connection refused because of a timeout isn't something that should happen normally. I would check again if the certificate is properly installed and not self-signed.

Hi @korchev
I have also tried the CRMBlazorWasmRBS Project, here also I am facing the same login redirection issue at production side but when i run the project locally it works properly