Adding custom claims in the callback after an external IdP authenticates does not appear to emit these claims back to consuming app #203
Replies: 5 comments 3 replies
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks @RolandGuijt , I had the HttpContext.SigninAsync(), however the custom claim types being created were 3 characters long and for some reason were not being emitted back. I changed the claim types to a longer value which worked. Do you know why the smaller length claim types were not being included? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @RolandGuijt, Pulled the trigger a bit earlier; it is still not working; code snippet: When the response comes back to the browser code, the collection of claims does not have the claim "SomeNewClaimType" Thanks |
Beta Was this translation helpful? Give feedback.
-
|
No, the example claim type is not part of the scope requested by the client. It is an example of a claim that is created by the service provider in the callback within the service. I do want to point out that the in the class that implements IProfileService, in the GetProfileDataAsync() if said claim is added to the context.IssuedClaims (context is ProfileDataRequestContext), from the context.Subject.Claims then the example claim type is emitted back. Is this the right approach? |
Beta Was this translation helpful? Give feedback.
-
|
Great; thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am running a .NET8 WebAPI service that includes IdentityServer v7.
Scenario:
What could I be missing?
Thanks
Note: I am adding a different custom claim in another class that implements IProfileService and this claim is present in the OnTokenValidated event handler but logic in the callback handler cannot be included in the class that implements the IProfileService.
Beta Was this translation helpful? Give feedback.
All reactions