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

Added tracing to the userprofile controller #1068

Merged
merged 2 commits into from
Oct 14, 2020
Merged

Added tracing to the userprofile controller #1068

merged 2 commits into from
Oct 14, 2020

Conversation

FuriousLlama
Copy link
Contributor

@FuriousLlama FuriousLlama commented Oct 14, 2020

Fixes or Implements AB#9358

  • Enhancement
  • Bug
  • Documentation

Status Ready

Description

Added logging to the user profile api. Added new object handlers for claim and identity serialization.

NetwonSoft needs to be used since the current version of .net serializer does not handle claims

https://www.thecodebuzz.com/jsonexception-possible-object-cycle-detected-object-depth/

Testing

  • Unit Tests Updated
  • Functional Tests Updated
  • Not Required

@@ -109,6 +116,12 @@ public async Task<IActionResult> CreateUserProfile(string hdid, [FromBody] Creat
public IActionResult GetUserProfile(string hdid)
{
ClaimsPrincipal user = this.httpContextAccessor.HttpContext.User;
var jsonSettings = new JsonSerializerSettings()
{
Converters = new List<JsonConverter>() { new JsonClaimConverter(), new JsonClaimsPrincipalConverter(), new JsonClaimsIdentityConverter() },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why do we need all of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately the claims serialization is not done by default (no default converters can do it). So these custom converters do the job.

Similar issues: codekoenig/AspNetCore.Identity.DocumentDb#22

Copy link
Contributor

@tiagografiti tiagografiti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit tests failed

@FuriousLlama
Copy link
Contributor Author

unit tests failed

fixed

@FuriousLlama FuriousLlama merged commit 846b40c into dev Oct 14, 2020
@FuriousLlama FuriousLlama deleted the features/9358 branch December 18, 2020 22:26
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

Successfully merging this pull request may close these issues.

3 participants