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

Error: The trust relationship between this workstation and the primary domain failed #2

Open
sigeje opened this issue Nov 22, 2019 · 0 comments

Comments

@sigeje
Copy link

sigeje commented Nov 22, 2019

When I was working on Chapter 03 Challenge, I got an error saying "The trust relationship between this workstation and the primary domain failed" in _Layout.cshtml line 32.

@if (User.IsInRole(HPlusSports.Models.UserRoles.Admin))

I use Windows 10, Visual Studio 2017 Community Edition and IIS Express when got this error.

From this solution, I found that User.IsInRole seems to throw an exception when Windows.Identity.IsAuthenticated is false. So I use that solution, adding an authentication checking before User.IsInRole.
Below is the solution.

@if (User.Identity.IsAuthenticated && User.IsInRole(HPlusSports.Models.UserRoles.Admin))

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