Open FinHorsley opened 11 months ago
Yes, it takes the claims from the id_token, you can see the affected code in the file https://github.com/authts/oidc-client-ts/blob/main/src/ResponseValidator.ts. Follow there response.profile =
...
@pamapa following up on this, I can't find a way to extend the type/interface of the profile
object to include the claims that the token actually has and that i can see stored in local storage (ie employeeId
in my usecase).
I've successfully done this with Express in the backend by extending the User interface like this:
declare namespace Express {
interface User {
...
employeeId: string;
....
}
}
Maybe I am blind or looking at this at the wrong angle, but any help here would be appreciated, thanks!
Apologies in advance if this has been answered before, I've had a good look through the existing docs/issues/prs but may have missed something!
Does the library expose any of the claims data from within the accessToken, or is it all provided by the idToken/userinfo endpoints? Looking at https://github.com/authts/oidc-client-ts/issues/477#issuecomment-1092505083, this suggests that it's only fetched from the id_token, but just wanted to double check.
Thanks 🙂
Edit: Found this from the oidc-client-js repo, basically just confirming if this library follows the same model? https://github.com/IdentityModel/oidc-client-js/issues/54