Blorc.OpenIdConnect icon indicating copy to clipboard operation
Blorc.OpenIdConnect copied to clipboard

Add user and profile claims

Open gao-sun opened this issue 1 year ago • 5 comments

Description of Change

Models

  1. Extend User and Profile class by adding claims defined in oidc-client-ts:
  1. Add AdditionalData property in Profile to allow unknown properties in the ID token, as identity providers may add new claims from time to time.

Extenstions

Support AsClaims for JsonElement.

Issues Resolved

It providers a better dev experience for integrating various identity providers. E.g. some developers may need to read the sub claim to handle user ID.

API Changes

None. I considered aligning nullable definitions, for example, making AccessToken required for User, but it appears to be a breaking change. So I've decided to leave them as they are.

Behavioral Changes

None

Testing Procedure

  • Updated and added unit tests for JSON and claim deserialization. image

  • Tested locally with Logto, the sign-in flow works as expected. image

PR Checklist

  • [x] I have included examples or tests
  • [ ] I have updated the change log (didn't find)
  • [ ] I am listed in the CONTRIBUTORS file (didn't find)
  • [x] Changes adhere to coding standard
  • [x] I checked the licenses of Third Party software and discussed new dependencies with at least 1 other team member

gao-sun avatar Feb 01 '24 03:02 gao-sun

@GeertvanHorrik @alexfdezsauco Apologize for the large pull request. Please let me know if it aligns with the direction of this project. Thank you for your time in advance.

gao-sun avatar Feb 01 '24 04:02 gao-sun

Thanks, we'll review ASAP. I noticed you did a non-breaking change, but.... since this is a large update (improvement) and we want to upgrade to the 3.0.0 client anyway, this might be a good time to introduce breaking changes. So if you feel it will improve the component, go ahead :)

GeertvanHorrik avatar Feb 01 '24 08:02 GeertvanHorrik

My compliments, really great work, thank you!

Please see the comments, hopefully they all make sense. If not, feel free to comment back 👍

I went through the comments, they are awesome! I'll update per your comments soon. Thank you for your time!

gao-sun avatar Feb 01 '24 08:02 gao-sun

Can we help on that pull request to close it?

kjbtech avatar Apr 29 '24 07:04 kjbtech

@alexfdezsauco can we close this one or does it need a lot of work?

GeertvanHorrik avatar Apr 29 '24 22:04 GeertvanHorrik

Any news on this one?

kjbtech avatar May 16 '24 09:05 kjbtech

Hello, Any update on this?

kjbtech avatar Jul 19 '24 08:07 kjbtech

@GeertvanHorrik @alexfdezsauco

Can I help to finish this pull request? What is the matter?

kjbtech avatar Jul 31 '24 12:07 kjbtech

We requested some changes to @gao-sun

alexfdezsauco avatar Jul 31 '24 14:07 alexfdezsauco

@alexfdezsauco I'm gonna try to take over his work.

kjbtech avatar Aug 01 '24 16:08 kjbtech

Closing this PR in favor of #636 . Thanks @gao-sun for the initial changes, the new PR will still contain your changes but we will try to finalize this PR with the help of @kjbtech .

GeertvanHorrik avatar Aug 05 '24 14:08 GeertvanHorrik