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

No service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Models.ApplicationUser]' #4

Closed
a-a-k opened this issue Jul 6, 2020 · 4 comments
Assignees

Comments

@a-a-k
Copy link

a-a-k commented Jul 6, 2020

I'm using LiteDB.Identity in project based on SPA (Angular) template. I changed Statup.cs as it shown in readme. The error was thrown when I tried to access protected sources (via [Authorize] attribute).
What's going wrong?

@quicksln
Copy link
Owner

Hi @a-a-k

Thank you for using LiteDB.Identity.

Could I kindly ask you to double check connection string configuration for LiteDB:
https://github.com/quicksln/LiteDB.Identity/blob/master/sample/LiteDB.Identity.Sample/appsettings.json

Next, please check if all references have been added correctly to your project definition :
https://github.com/quicksln/LiteDB.Identity/blob/master/sample/LiteDB.Identity.Sample/LiteDB.Identity.Sample.csproj

At the very end please double check Configure section of Startup.cs if contains :

app.UseAuthentication();
app.UseAuthorization();

https://github.com/quicksln/LiteDB.Identity/blob/master/sample/LiteDB.Identity.Sample/Startup.cs

And let me know how it went.

Regards
Piotr

@a-a-k
Copy link
Author

a-a-k commented Jul 13, 2020

@quicksln thank you for your reply!
All things you mentioned are same.
Okay, seems the problem is underlying deeper. I think it is in auth mechanisms which provided by SPA template. There IdentityServer and its stuff. Now I'm getting Error: Could not load settings for 'App' at AuthorizeService.js.

@quicksln
Copy link
Owner

Hello @a-a-k

Thank you for additional information. Unfortunately, I did not have chance to try IdentityServer4
with ASP.NET Identity over LiteDb.Identity.

But according to IdentityServer4 documentation, in theory it should be possible to use both, please have a look on following links:

https://docs.identityserver.io/en/release/reference/aspnet_identity.html
https://docs.identityserver.io/en/release/quickstarts/6_aspnet_identity.html

Hope you find this helpful.

Regards
Piotr

@a-a-k
Copy link
Author

a-a-k commented Jul 20, 2020

Hi, Piotr.
Looks like no deal with IdentityServer without EF is possible.
IdentityServer/IdentityServer4#4667

@a-a-k a-a-k closed this as completed Jul 24, 2020
@quicksln quicksln self-assigned this Feb 24, 2024
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

2 participants