Hi ,
Following is the error written in logs.txt
DEBUG 2018-01-11 13:42:52,966 [1 ] Abp.Owin.OwinUserTokenProviderAccessor - DataProtectionProvider has not been set yet.
Thanks
Hi,
public virtual async Task<ActionResult> ExternalLoginCallback(string returnUrl, string tenancyName = "") { returnUrl = NormalizeReturnUrl(returnUrl);
**var loginInfo = await _authenticationManager.GetExternalLoginInfoAsync();**
if (loginInfo == null)
{
return RedirectToAction("Login");
}
//Try to find tenancy name
if (tenancyName.IsNullOrEmpty())
{
tenancyName = _tenancyNameFinder.GetCurrentTenancyNameOrNull();
if (tenancyName.IsNullOrEmpty())
{
var tenants = await FindPossibleTenantsOfUserAsync(loginInfo.Login);
switch (tenants.Count)
{
case 0:
return await RegisterView(loginInfo);
case 1:
tenancyName = tenants[0].TenancyName;
break;
default:
return View("TenantSelection", new TenantSelectionViewModel
{
Action = Url.Action("ExternalLoginCallback", "Account", new { returnUrl }),
Tenants = tenants.MapTo<List<TenantSelectionViewModel.TenantInfo>>()
});
}
}
}
var loginResult = await _logInManager.LoginAsync(loginInfo.Login, tenancyName);
switch (loginResult.Result)
{
case AbpLoginResultType.Success:
await SignInAsync(loginResult.User, loginResult.Identity, true);
return Redirect(returnUrl);
case AbpLoginResultType.UnknownExternalLogin:
return await RegisterView(loginInfo, tenancyName);
default:
throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(loginResult.Result, loginInfo.Email ?? loginInfo.DefaultUserName, tenancyName);
}
}
When it came to above method, it is giving null to login info in highlighted line.
Hi,
I am using goolge SSO to login. when i click goolge button it taken to select user and come back to login page. It is not allowing me to go to index page.
i added keys in web config.
Thanks Himanshu sharma
Hi,
Is there any other possibility to implement this?
Thanks
Hi ,
I want to fix first column in jtable. How can i achieve this ?
Thanks
Thanks for the reply! Can you please explain what does this do?
I have made a HTMLHelper extension method to be used from the Razor view. When this method gets called, some logic is required to get information from some other class/method. This class uses dependency injection.
Now I'm not sure how can I call that class from the extension method.
Please see below for the code-
public static class VehicleTrackingFieldAccessHtmlHelper
{
public static IHtmlString VehicleTrackingFieldAccessFor<TModel, TValue>(
this HtmlHelper<TModel> html,
Expression<Func<TModel, TValue>> expression,
int VT_ID,
long OU_ID)
{
var x = ModelMetadata.FromLambdaExpression<TModel, TValue>(expression, html.ViewData);
if (x.AdditionalValues.ContainsKey(CreateNewVehicleTrackingInput.FieldAccessKey))
{
var vtField = (Enums.Database.VT_Fields)x.AdditionalValues[CreateNewVehicleTrackingInput.FieldAccessKey];
// Error/Problem is at this line
// This constructor requires an argument (_vehicleTrackingFieldAccessAppService) to be passed.
// But we don't have access to it here.
return new VehicleTrackingFieldAccessHtmlHandler().ProcessFields(vtField, VT_ID, OU_ID).Result;
}
return new HtmlString("");
}
}
public class VehicleTrackingFieldAccessHtmlHandler
{
private readonly IVehicleTrackingFieldAccessAppService _vehicleTrackingFieldAccessAppService;
public VehicleTrackingFieldAccessHtmlHandler(IVehicleTrackingFieldAccessAppService vehicleTrackingFieldAccessAppService)
{
_vehicleTrackingFieldAccessAppService = vehicleTrackingFieldAccessAppService;
}
private async Task<IHtmlString> ProcessFields(Enums.Database.VT_Fields vtField, int VT_ID, long OU_ID)
{
var fieldAccess = await GetUserPermissionsForVtFields(VT_ID, OU_ID);
switch (vtField)
{
case Enums.Database.VT_Fields.Customer_First_Name:
return new HtmlString("");
default:
return new HtmlString("");
}
}
}
Thanks
ASP.NET Zero has Role-based access and we can perfectly control actions (Create, Read, Update and Delete) that a user can perform.
How about field level authorization? We need the ability to control user by role and some other conditions to define their access level to each field. For example, a form has a field "Date". While creating new entry, some can pick value for "Date" field however, other user should not be able to see this field but they may update it in the existing records or may be not.
Is it something already offered in ASP.NET Zero?
I have seen that already and it states- "In AspNet Zero, Tenant, User and Role entities are abstract in the framework, others are not. "
So, since they are not allowing to extend this entity, I have created a separate table and storing the OU ID there and adding other fields as a solution.
We want to link OUs to a separate table. Is it possible add a new column with Foreign Key constraint in OrganizationUnit table? Please guide if so,