Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SigninManager on Asp.Net 6 Identity returns failure when app is deployed #51

Open
BaronMatrix opened this issue Jul 8, 2022 · 0 comments

Comments

@BaronMatrix
Copy link

Hi,
I'm having a weird issue and this is the last place to search for an answer. I have created a site for deployment to my ISP. Whenever I try to sign in with users created locally it returns Result.Failed. I'm using the generic Identity scaffold with Personal Data added.

I have deployed another site to the same ISP with the same boiler plate code and it worked fine. I found the error by returning result.ToString() in the else statement in Login.cshtml.cs as the PasswordSighInAsync function only returns a status message and not an error.

else
{
     ModelState.AddModelError(string.Empty, result.ToString());
    return Page();
}

I checked the SigninManager code here and there are three situations when failure is assigned, but it's not clear why logging into the same remote DB with the same ApplicationDbContext succeeds when I run locally in either debug or release.

I also hit the error below when trying to register from the .com web site and it doesn't happen locally. But checking the DB the user is created. Testing also showed that setting RequireConfirmedAccount to false still returns NotAllowed.

Turning off the RequireConfirmed was necessary becuase the GenerateTokenAsync() call would fail

**Error.
An error occurred while processing your request.

Request ID: 00-825112947d1a57ef4eca465146ff6805-747b92bafdb872df-00
Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant