public async Task <ActionResult> ResetSecret(string appId)
        {
            using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                IsolationLevel = IsolationLevel.RepeatableRead
            }, TransactionScopeAsyncFlowOption.Enabled))
            {
                object aaa = new { };
                try
                {
                    IdentityResult result = IdentityResult.Failed();
                    var            app    = await ClientManager.FindByNameAsync(appId);

                    if (app == null)
                    {
                        return(Json(aaa));
                    }
                    if (await ClientManager.HasPasswordAsync(app.Id))
                    {
                        result = await ClientManager.ChangePasswordAsync(app.Id, app.PasswordHash, Guid.NewGuid().ToString("n") + Guid.NewGuid().ToString("n"));
                    }
                    else
                    {
                        result = await ClientManager.AddPasswordAsync(app.Id, Guid.NewGuid().ToString("n") + Guid.NewGuid().ToString("n"));
                    }
                    if (result.Succeeded)
                    {
                        aaa = new
                        {
                            AppId  = app.UserName,
                            Secret = app.PasswordHash,
                            app.Name,
                            app.Description,
                            RedirectUri = app.CallbackUrl,
                            app.Status,
                        };
                    }
                    scope.Complete();
                }
                catch (Exception ex)
                {
                }
                finally
                {
                }
                return(Json(aaa));
            }
        }