<tr> <td> <div class="display-label"> @Html.DisplayNameFor(model => model.AssignedLicenses) </div> </td> <td> <div class="display-field"> @Html.DisplayFor(model => model.AssignedLicenses) </div> </td> </tr>
public async Task<ActionResult> Details(string objectId) ///details method { User user = null; try /// authenticate and wait to get details { ActiveDirectoryClient client = AuthenticationHelper.GetActiveDirectoryClient(); user = (User)await client.Users.GetByObjectId(objectId).ExecuteAsync(); } catch (Exception ex) { if (Request.QueryString["reauth"] == "True") { // // Send an OpenID Connect sign-in request to get a new set of tokens. // If the user still has a valid session with Azure AD, they will not be prompted for their credentials. // The OpenID Connect middleware will return to this controller after the sign-in response has been handled. // HttpContext.GetOwinContext() .Authentication.Challenge(OpenIdConnectAuthenticationDefaults.AuthenticationType); } ViewBag.ErrorMessage = "AuthorizationRequired"; Logger.Error(ex); return View(user); } return View(user); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)