Skip to content

SignIn VerifyState activity state may be json objects on android and ios devices #302

@bigbearzhu

Description

@bigbearzhu

Please refer to OfficeDev/microsoft-teams-library-js#2189, OfficeDev/microsoft-teams-library-js#528. The state property may not be string type, so it can cause json deserialization error when user signin on android and ios devices.

System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $.value.state | LineNumber: 0 | BytePositionInLine: 1123.
[ERROR]  ---> System.InvalidOperationException: Cannot get the value of a token type 'StartObject' as a string.
[ERROR]    at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType)
[ERROR]    at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)        
[ERROR]    at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
[ERROR]    at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)        
[ERROR]    at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)   
[ERROR]    --- End of inner exception stack trace ---
[ERROR]    at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)   
[ERROR]    at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
[ERROR]    at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
[ERROR]    at Microsoft.Teams.Api.Activities.Invokes.SignInActivity.JsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)   
[ERROR]    at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
[ERROR]    at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
[ERROR]    at Microsoft.Teams.Api.Activities.InvokeActivity.JsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)  
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)   
[ERROR]    at System.Text.Json.JsonSerializer.ReadFromNode[TValue](JsonNode node, JsonTypeInfo`1 jsonTypeInfo)
[ERROR]    at Microsoft.Teams.Api.Activities.Activity.JsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)        
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
[ERROR]    at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)   
[ERROR]    at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
[ERROR]    at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
[ERROR]    at Microsoft.Teams.Plugins.AspNetCore.AspNetCorePlugin.ParseActivity(HttpRequest httpRequest)
[ERROR]    at Microsoft.Teams.Plugins.AspNetCore.AspNetCorePlugin.Do(HttpContext httpContext, CancellationToken cancellationToken)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions