Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void ReadFeatureServices(User user, string admin, string adminpass) {
- string savedUrl = GetServerUrl();
- if (string.IsNullOrEmpty(savedUrl)) {
- NeApiAccess.Instance.Logger.ShowErrorDialog("You do not have a server URL stored, please provide server url OB SERVER FORM");
- return;
- }
- var newUser = new UserCreation {
- username = user.UserId,
- password = user.FirstName,
- fullname = user.FullName,
- email = user.Email,
- description = user.Description
- };
- string json = JsonConvert.SerializeObject(newUser);
- var tokenEnc = GetToken(adminUser, adminPass, savedUrl);
- if (tokenEnc == null)
- return;
- var values = JsonConvert.DeserializeObject<Dictionary<string, object>>(tokenEnc);
- if (values.ContainsKey("status")) {
- NeApiAccess.Instance.Logger.LogError("Unable to get token");
- foreach (var key in values.Keys) {
- NeApiAccess.Instance.Logger.LogError(key + ":" + values[key]);
- }
- return;
- }
- var token = values["token"].ToString();
- // I have the token, the connection. next step here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement