Base solution for your next web application

Activities of "enerjisauretim"

Configuration.Modules.AbpAspNetCore().DefaultWrapResultAttribute is also get-only property, so that I am unable to override the existing filter. Configuration.Modules.AbpAspNetCore().DefaultWrapResultAttribute.WrapOnError is not a function, in which I can resolve a HttpContext and decide to return a wrapped result or not.

Hi there,

Today I upgraded to the latest version of the aspnetzero framework, to enable Office365 login support for our corporate Azure Active Directory domain. However, it is not working. I have searched a lot, but it seems I have to rewrite the MSAL.js usage in order to make it working accordingly.

Could you please take a look to our configuration? Here is the configuration file for OpenID:

`"OpenId": {
      "IsEnabled": "true",
      "ClientId": "a6f3e01c-5eeb-4cce-8fce-e8df964152f2",
      "Authority": "https://login.microsoftonline.com/a730caa6-12ef-4586-9f28-6cfc59c76a6a/",
      "LoginUrl": "https://login.microsoftonline.com/",
      "ValidateIssuer": "true",
      "ClaimsMapping": [
        {
          "claim": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
          "key": "http://schemas.microsoft.com/identity/claims/objectidentifier"
        }
      ]
    },`

From the Azure Portal, I created an app registration, took clientid (a6f..) and tenant ids (a730...). The button is visible,** but after any successful login, it redirects me to the office.com**, instead of my application. I first tried on localhost, then on our test address. None of them working.

I found the problem; It resides to the fact that OpenIdConnecAuthProviderApi needs two claims to be properly set, one for user fullname and the other for email address. However, there are lots of bugs in that provider such as:

 Claim claim1 = validateTokenResult.Principal.Claims.FirstOrDefault<Claim>((Func<Claim, bool>) (c => c.Type == "name"));
      if (claim1 == null)
        throw new UserFriendlyException("name claim is missing !");
      Claim claim2 = validateTokenResult.Principal.Claims.First<Claim>((Func<Claim, bool>) (c => c.Type == "unique_name"));
      if (claim1 == null)
        throw new UserFriendlyException("unique_name claim is missing !");
      string[] strArray = claim1.Value.Split(' ', StringSplitOptions.None);
      return new ExternalAuthUserInfo()
      {
        Provider = "OpenIdConnect",
        ProviderKey = validateTokenResult.Token.Subject,
        Name = strArray[0],
        Surname = strArray.Length > 1 ? strArray[1] : strArray[0],
        EmailAddress = claim2.Value
      };

Claim1 for user fullname and claim2 is for email address. When email address claim is not found, Sequence Contains No Elements exception is being thrown instead of an UserFriendlyException. We spend 3 whole days to configure it according to Azure AD B2B OpenId authentication. You must improve documentation for us to understand where we can get authority, login url and other relevant parameters.

Final configuration is shown below:

    "OpenId": {
      "IsEnabled": "true",
      "ClientId": "{clientid}",
      "TenantId": "{tenantid}",
      "Authority": "https://login.microsoftonline.com/{tenantid}/v2.0",
      "LoginUrl": "https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",
      "ValidateIssuer": "false",
      "ClaimsMapping": [
        {
          "claim": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
          "key": "http://schemas.microsoft.com/identity/claims/objectidentifier"
        },
        {
          "claim" : "unique_name",
          "key": "preferred_username"
        }
      ]
    },
Question

Hello there,

I just want to ask you about the Blazor part of your roadmap. I've read your previous answers but they seemed old to me.

Do you have any plans for Blazor in near future?

Answer

Hi,

We are starting a new project, based on aspnetzero and will be using blazor for the frontend side.

Blazor looks promising actually. I am not sure whether we will be able to replace the web.host project with blazor or not.

Hello there,

I executed both "yarn" and "npm run create-bundles" scripts. However, here is the screenshot of chrome errors. No requests get a 404 response from server btw.

The problem is the confusion between web.host and web.mvc projects. We were trying to use Blazor with the Mvc project. After renaming all hardcoded strings ("Web.Host" -> "Web.Blazor") and moving some missing files by comparing two folders, everyting worked fine.

Hello there,

We want to implement another .netcore project using an aspnetzero project's existing user, role and claims.

In other terms, we will have some side projects that represent some external modules of our zero project. And all of these projects users, role and claim mapping must be managed within the zero project. Is there any capability of aspnetzero framework which we should be using to satisfy this need?

we are thinking about identity server4 as the last option by delegating all user info to that server.

Thanks for the reply. When we switch to identity server and connected both main app and side projects to them, does roles and permissions are automatically stored to that identity server? i am unsure about it and had no time to make a demo project to test it.

Prerequisites

  • Power tools version: 2.7.3
  • Angular project
  • .net core

Hello there, Using power tools window, I attach some enities that are not within the current project folder, to create a relation with them. Lets say, I have a CustomerLicense entity and an external Customer entity which is outside of the current solution (CustomerLicense -> Customer relation in our case).

Using the attached GetAllForLookupTableInput.7z template, the generator results in GetAllForLookupTableInput.cs file, in which it seems it does not understand any relation with external Customer entity and does not replate {{NP_Foreign_Entity_Name_Here}} fields. Indentation of output file is broken thanks to Visual Studio btw.

Showing 21 to 30 of 36 entries