I am wondering why the roles are empty on the AuthenticateResponse when I make an Authentication request using the typescript service client. The roles work as expected and I can see them on my UserSession but they do not populate on the response just an empty array. Is there a way to return these when authenticating? Or do I need to write my own endpoint to handle this?
They should be and can confirm that they are being returned in a new https://jamstacks.net template.
AuthFeature.IncludeRolesInAuthenticateResponse
controls whether Roles are returned in AuthenticateResponse
which defaults to true. What version are you using?
We are using 6.0.2 using a MicrosoftGraph provider (where roles come from and again can see on user session on the back end when I set a breakpoint and secured endpoints work as expected) and a JwtAuthProvider as our auth setup.
If the Roles is populated on the User Session it should be returned:
Can’t tell why it wouldn’t be populated from here, are the roles returned when querying /auth
or /auth.json
after successfully authenticated?