Closed evnexus closed 6 years ago
I don't know if this was implemented before or after my message, but the solution to it is:
getRoles() {
const context = Authentication.getContext(this.createConfig());
let user: any = context.getUser() != null ? context.getUser() : null;
return user.roles;
}
I've been asked to implement an Angular 2 application with O365 Auth and roles. So, I've modified the manifest file on AD so i've that one done. I could obviously make it all on my API, but that would mean more calls, but I see that adal-ts has a potential to have an extra property role at the user.ts class.
EDIT - By that I mean: Represents all application roles that the subject has been granted both directly and indirectly through group membership and can be used to enforce role-based access control. Application roles are defined on a per-application basis, through the appRoles property of the application manifest. The value property of each application role is the value that appears in the roles claim.
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-token-and-claims