Angular 7 - Get logged in username after Azure AD authentication

Viewed 2302

I have hosted a new Angular 7 App in Azure app service. Also added Azure AD authentication for same based on https://docs.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad

the AD authentication is working (when i take site, it goes to microsoft login page and once login retruns back)

My issue now is how will be get the logged in username to show in UI? i searched many links but nothing that helps for a beginner like me. can anyone help me on this?

3 Answers

You can use this.adalService.userInfo.profile.name to get the username for additional information you can check the responce here this.adalService.userInfo if you are using "adal-angular4" Module.

Related