private void OnSearch(object sender, EventArgs e) { Log("Searching for {0}...", textSearchUserId.Text); Log(" > Client Id: {0}", textSearchClientId.Text); Log(" > Domain: {0}", textSearchDomain.Text); try { var client = new Auth0.Client(textSearchClientId.Text, textSearchClientSecret.Text, textSearchDomain.Text); var user = client.GetUser(textSearchUserId.Text); if (user != null) { Log("User found!"); Log(" > Data:\r\n\r\n{0}\r\n", Newtonsoft.Json.JsonConvert.SerializeObject(user, Newtonsoft.Json.Formatting.Indented)); } else { Log("User not found!"); } } catch (Exception ex) { Log("User not found!"); Log(" > Error: {0}", ex.Message); } }
private static string GetBoxIdFromAuth0(string auth0UserId) { var auth0User = AUTH0_CLIENT.GetUser(auth0UserId); var boxId = auth0User.ExtraProperties.FirstOrDefault(p => p.Key == BOX_USER_ID_KEY).Value; return((string)boxId); }