I have a web application that pre-populates a form with the users info where applicable. For populating the users name, I have used the ClaimsPrincipal
to return the info as below:
Private Sub WebApp_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim cp As ClaimsPrincipal = ClaimsPrincipal.Current
txtName.Text = cp.FindFirst(ClaimTypes.GivenName).Value & " " & cp.FindFirst(ClaimTypes.Surname).Value
End Sub
I also need to return the users Job Title and Department. How can I access the Azure AD Profile in code behind? I've looked at this thread and it looks as if it's pointing towards the Graph API, but am not sure if this would allow me to access it in the Code Behind or how I can even do this.