Comments (3)
I'm also using IdentityServer4 and have it running fine against the
AspNetCore.Identity.DocumentDb . Partitioning is definitely an issue and I'll probably have to go with a Mongo implementation without it. I used this to fix the convert issue.
`public class JsonClaimConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(Claim));
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
IList<Claim> claims = new List<Claim>();
JToken jt = JObject.ReadFrom(reader);
for (int i = 0; i < jt.Count(); i++)
{
string type = jt.Values<string>("Type").ElementAtOrDefault(i);
string value = jt.Values<string>("Value").ElementAtOrDefault(i);
string valueType = jt.Values<string>("ValueType").ElementAtOrDefault(i);
string issuer = jt.Values<string>("Issuer").ElementAtOrDefault(i);
string originalIssuer = jt.Values<string>("OriginalIssuer").ElementAtOrDefault(i);
claims.Add(new Claim(type, value, valueType, issuer, originalIssuer));
}
return claims;
}
public override bool CanWrite
{
get { return false; }
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var claim = (Claim)value;
JObject jo = new JObject
{
{ "Type", claim.Type },
{ "Value", claim.Value },
{ "ValueType", claim.ValueType },
{ "Issuer", claim.Issuer },
{ "OriginalIssuer", claim.OriginalIssuer }
};
jo.WriteTo(writer);
}
}`
I also added this to the DocumentDBUserStore for the FindBy... issues.
IQueryable<TUser> IQueryableUserStore<TUser>.Users => documentClient.CreateDocumentQuery<TUser>(collectionUri) .Where(u => u.DocumentType == typeof(TUser).Name) .AsQueryable();
from aspnetcore.identity.documentdb.
I have the same problem. Is there any work around how to resolve that issue?
from aspnetcore.identity.documentdb.
@vindemi I have not found any solutions for this issue. If I am not mistaken, Microsoft is working to support JsonConvert.DefaultSettings
but I do not have any idea when will they finish it.
Our solution was to not use Claims but Roles instead. The serialization of Roles is not a problem.
But soon we will move to Identity Server with SQL Server because this library is not maintained and it has this issue, also it does not support partitioning so I do not think that it is production ready.
from aspnetcore.identity.documentdb.
Related Issues (20)
- Has anyone got this running in a web api project? HOT 1
- Not able to compile samples in Visual Studio for Mac HOT 1
- remove claim does not work HOT 3
- AspNetCore 2.0 HOT 8
- Error running application after upgrade to core 2.0 HOT 5
- deserializing claims
- Unable to log back in after creating a user, null as part of the Claims Process
- Take document db collection name as parameter HOT 1
- ObjectDisposedException HOT 1
- Missing method exception after upgrading to SDK 2.1.3
- Question - How are the document updated? HOT 1
- TypeLoadException: Method 'NormalizeName' in type 'LookupNormalizer' does not have an implementation HOT 5
- SSL should be enabled in the sample
- AddDefaultDocumentClientForIdentity is missing from NuGet package HOT 3
- Is it considered to change dependency to Microsoft.Azure.Cosmos?
- Use IDocumentClient instead of DocumentClient HOT 1
- Subclass Userstore to allow using it without any RoleStore
- Adding samples how to use and manage Roles HOT 1
- Getting exception BadRequestException: Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to true, specify x-ms-documentdb-partitionkey, or revise your query to avoid this exception. HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnetcore.identity.documentdb.