Base solution for your next web application

Activities of "blewis"

I am really interested in using APB in a new project for my company, and even getting Asp.Net Zero. However, at least for this upcoming project, we have to authenticate our web app against an existing OpenAM identity server that uses SAML. I have found the Kentor AuthServices library (<a class="postlink" href="https://github.com/KentorIT/authservices/">https://github.com/KentorIT/authservices/</a>), which supports SAML and makes integration with MVC easy. I downloaded the Abp Sample MVC 5.x multi-page project and installed the AuthServices NugGet packages, and added the necessary configuration for AuthServices to the web.config.

Essentially, AuthServices replaces the normal login page with a redirect to the external OpenAM SAML server. This part works fine. If I try to access a protected page, it redirects me to our 3rd party OpenAM server. I authenticate there, then it POSTs an assertion (an XML file) back to the AuthServicesController that contains the user info (name, roles, etc). When I debug the incoming POST to the controller, I can see that it has set the appropriate Identity info and claims information.

However, at this point I am now in the AuthServicesController and I need to hook into Abp's auth/login pipeline. It's sort of like an external auth provider, but I am not using the regular Abp login form. I need to check to see if this user already exists in the Adp DB, if not, add it (and update their Adp user roles). Then log them in. I can't get them logged in and a proper Adp session.

This process is probably a lot like ADFS federated auth or OpenID. You mention support for these on the Asp.Net Zero page, but there a no other references to it.

Any pointers would be appreciated, Bryan

We are evaluating using ABP for a new project. We plan on hosting it as an Azure WebApp (PaaS) and direct SMTP is not an option. For other apps we have created in the past (not using ADP), we have used SendGrid. Do I just need to create a new SendGrid Email class inheriting from your EmailSenderBase and inject that? Has anyone already solved this problem?

Thanks, Bryan

This is my first ADP project -- we just bought Zero. I downloaded version 4.0.0 and I'm starting a new Asp.Net CORE & jQuery MPA project. When I first load it into VS2017, it compiles and runs. Then I do a NuGet package update, which involves about 45 packages across all of the projects (including many ADP packages). After the update, I get multiple errors:

Error CS1061 'IServiceCollection' does not contain a definition for 'AddAbpIdentity' and no extension method 'AddAbpIdentity' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) NweaCore.Web.Mvc ...\src\NweaCore.Web.Mvc\Startup\Startup.cs 49 Active

Error CS0516 Constructor 'PermissionChecker.PermissionChecker(UserManager)' cannot call itself NweaCore.Core ...\src\NweaCore.Core\Authorization\PermissionChecker.cs 14 Active

For the first error, I can make it go away by changing services.AddAbpIdentity<Tenant, User, Role, SecurityStampValidator>(options => to services.AddAbpIdentity<Tenant, User, Role>(options =>

But I cannot fix the second error no matter what and I cannot compile the solution. Any pointers? Sorry, I am new to the source at this point. Is it typical for errors to crop up when updating ADP packages?

This is a fresh copy of the code, I haven't made any changes at all other than package updates.

Thanks, Bryan

If I want to completely disable the chat function from a particular app that I'm building, is it best to remove the FEATURE_SIGNALR compilation symbol from the project? I just want to ensure that the SignalR/Chat related code doesn't load/add overhead when it's not going to be used at all.

Thanks, Bryan

The Zero Template comes with the _layout.cshtml file containing a hardcoded page title (title tag). Is there an easy/built-in way to make the name of the active menu/nav item the page title? I have looked through the docs and I don't see anything.

I have created a bunch of app services that inherit from AsyncCrudAppService, and everything works fine. However, when I am reviewing the Audit logs, the "Service" column for every call to GetAll() is "AsyncCrudAppService." I understand why, but it would be more useful if the log recorded my app service name, not the base service name. It makes it hard to keep track of things if all those calls are not differentiated. Just a suggestion.

Thanks, Bryan

Question

I am new to ABP and relatively new to AutoMapper, so I am a bit stumped about why some code is throwing an exception. I am trying to have one of my AppService methods return a Dto , but it throws an exception when I call ObjectMapper.Map().

The exception is : AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.

But since the "schools" variable is an anonymous type, I can't setup a mapping configuration, right? The Dto is super simple, just one field. I could eliminate the use of AutoMapper, but I would like to be consistent and use it in all cases just like the existing AppServices.

namespace MyProject.Organizations.Dto
{
    public class SchoolSearchDto
    {
        public string DisplayName { get; set; }
    }
}

The AppService method:

public async Task<ListResultDto<SchoolSearchDto>> SchoolSearch(SchoolSearchInput input)
        {
            var query = from uou in _extendedOrganizationUnitRepository.GetAll()
                        where uou.DisplayName.Contains(input.SchoolName)
                        select new { uou.DisplayName, uou.ParentId };

            var schools = await query.WhereIf(input.ParentId != null, p => p.ParentId == input.ParentId).ToListAsync();

            return new ListResultDto<SchoolSearchDto>(
                ObjectMapper.Map<List<SchoolSearchDto>>(schools)
                );
        }

I also tried using this return statement:

return new ListResultDto<SchoolSearchDto>(
                schools.Select(school =>
                {
                    var dto = ObjectMapper.Map<SchoolSearchDto>(school.ou);
                    return dto;
                }).ToList());

I have users across the United States and I need to display UTC dates that are stored in the DB in the user's local time. I understand all of the concepts of converting UTC times to local time within ASP.Net, but not within the ABP framework.

I am using the Asp.Net CORE MVC & jQuery project. Where should I be setting the clock provider to Utc? Startup.cs? After the provider is set, all I need to do is create a Abp.Timing.TimeZone setting for the tenant and/or user and my DB results from Entity Framework will be auto converted to the local timezone?

Thanks, Bryan

I will be deploying my project to Azure, which doesn't support SMTP. I have created a new EmailSenderSendGrid class that implements IEmailSender but uses the SendGrid API.

I then added:

IocManager.Register<IEmailSender, EmailSenderSendGrid>();

to the PostInitialize() method of my ProjectNameCoreModule.cs (in the Core project) in an attempt to register the new implementation. However, when I attempt to send an email from an MVC controller, it throws and exception and that exception is coming from Abp.MailKit.MailKitEmailSender. So that implies it's still trying to use MailKit and not my class. What am I doing wrong?

This is the first time I am trying to use the IocManager to register my own implementation...so perhaps I am screwing that up.

Thanks, Bryan

I use the AbpMvcAuthorize attribute on many controller methods (not the entire controller) to grant privileges. However, if the user doesn't have that permission, the default action of the attribute seems to be to redirect back to the login page. Because I am using OpenID SSO, it redirects the user to the SSO login page. What I want to do is to just take them to a static "Unauthorized" page that I have created. Is that possible?

Thanks, Bryan

Showing 1 to 10 of 14 entries