dlmelendez / identitycosmosdb Goto Github PK
View Code? Open in Web Editor NEWAzure CosmosDB Provider for ASP.NET Identity Core framework.
License: MIT License
Azure CosmosDB Provider for ASP.NET Identity Core framework.
License: MIT License
I tried to add a Role to the user during Registration using
await _userManager.AddToRoleAsync(user, "Admin");
but an exception is thrown "The role Admin does not exist".
Any docs on how to add a role?
Thanks
I have been able to successfully implement you solution for identity users but I am not able to get identity roles to work. Do you have any samples/documentation on how to implement roles with cosmos DB?
Hello David,
Thanks for great library. I just started a new DocumentDB-based project and I didn't want to hang a SQL database just for authentication/authorization.
This is probably a silly question, but it has puzzling me for a while, as I'm not very experienced with the .NET architecture (I'm coming from Python projects).
I see that the IdentityCloudContext
class exposes a Client
property, which is an instance of DocumentClient
. Also, I have an ApplicationDbContext
class that expands the IdentityCloudContext
, as the documentation suggests.
Then, my question is: Can (should?) I use my ApplicationDbContext
class to handle tasks that are not related to identity? (say.. query/insert/update "products"). If yes, how can I do that? I believe that I should wrap this class in a Singleton or something similar.
Or should I create a different class with a different instance of DocumentClient
to handle those requests?
Thank you so much in advance!
Cheers!
Hi and thanks for this great library :)
I have problems using LINQ to filter(.Where) and project(.Select) on the Users collection exposed byt UserManger class.
I can see that "ElCamino.AspNetCore.Identity.DocumentDB.Model.IdentityUser" is decorated with
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
also all of its properties are decorated with
[JsonProperty("camelCasePropertyName")]
But for some reason those attributes are ignored during SQL generation.
As a workaround I can override the properties I need to access in my ApplicationUser class(Inherits from "ElCamino.AspNetCore.Identity.DocumentDB.Model.IdentityUser") and decorate with the same JsonProperty attribute providing the same Property name (PascalCase).
I guess there was a reason for you to add those JsonProperty attributes in the first place, but currently it just doesn't work.
Steps to reproduce. Just add the following lines in an test action in the Account controller in the "samplecore2.mvc" available in this repository.
var userDBquery = _userManager.Users .Where(u => u.Id == id);
The generated SQL query will filter on "Id" (capital first letter). The same behavior if you use .Select LINQ extension method.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.