I'm integrating azure active directory using microsoft adal and spring boot. Now I'm only getting information of user only. I need to get the group as well as role information also. What are the steps I need to take care off. Any help would be appreciable.
app.module.ts
-----------------
function initializer(adalService: MsAdalAngular6Service) {
return () => new Promise((resolve, reject) => {
if (adalService.isAuthenticated) {
resolve();
} else {
adalService.login();
}
});
}
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientModule,
MsAdalAngular6Module.forRoot({
tenant: 'xxxbef18-40f6-44e6-972c-407462a99xxx',
clientId: 'xxx4602f-e3c8-4114-ae23-42bf9e57dxxx',
redirectUri: 'http://localhost:4200',
navigateToLoginRequestUrl: false,
cacheLocation: 'localStorage'
})
],
providers: [ {
provide: APP_INITIALIZER,
useFactory: initializer,
multi: true,
deps: [MsAdalAngular6Service]
},
{
provide: HTTP_INTERCEPTORS,
useClass: TokenInterceptorService,
multi: true
}],
bootstrap: [AppComponent]
})
export class AppModule { }
Getting the user information from below code
this.adalService.userInfo
You could call MS Graph to get user, roles, and groups. And you will need to add required permissions to your scope in the
API permissionsof the portal.Note: About the permission you need to add, you could refer to user permission, group permission, and role permission.
There is the issue about reading roles by msal-angular, see here.