Base solution for your next web application

Activities of "henryand"

We are upgrading ANZ to the latest (v10.4) and updating third party controls as well. The new PrimeNg controls are Angular 12. Will upgrading to Angular 12 break our ANZ solution?

we are using ANZ v10.1 Angular .Net5 combined

I am using localization to handle tenant specific wording translation. we use english for the base site and each tenant has a different default english variant for its default language. I would like to create new languages for each state in the US. Of course, these are not standard language cultures. For example, we could use Eng-CA (Canada) for California, but there is no existing Eng-FL for Florida. So, replacing Eng-BB (Barbados) with our Florida language works, but it would be nicer to have an Eng-FL. these are just examples, having all 50 states would be the goal.

Is this possible?

Thanks

Question

We are using ANZ v10.1 Angular dotNet 5 Combined version.

When we deploy to an Azure AppService Deployment Slot using Visual Studio, the backend API is published to ourdomain\wwwroot. The Angular frontend app is published to wwwroot\wwwroot\dist. Overall, it's about 7000 files being pushed to the cloud. Since the dist folder is not where the files need to be, I then have to use Filezilla to re-upload local wwwroot\wwwroot\dist to Azure wwwroot\wwwroot, or delete the files in Azure wwwroot\wwwroot so that I can move/rename the files from wwwroot\wwwroot\dist up one folder. This is a very time consuming process because the files aren't copied to where they need to be in the first place. On a slow internet day, it has taken a full hour to deploy our application, with much of that time just shuffling the Angular app files to where they belong.

So, is there a more efficient process?

Thanks

or did you mean that the TokenAuthController should just send the LogoutUrl from the configuration file?

thanks

  1. You can return the OpenID connect logout URL on TokenAuthController.cs I added a string output to the Logout to return the OpenId connect logoutUrl
    public async Task<string> LogOut() I added a call to my previously posted function to get the LogoutUrl return _openIdConnectAuthProviderApi.SendLogout(); I added a string output to the SendLogout function from above to return the LogoutUrl public string SendLogout()

  2. Then, handle it on Angular side here in app-auth.service.ts I added a parameter to the XmlHttpRequestHelper.ajax call I added a redirect to the LogoutUrl

                XmlHttpRequestHelper.ajax('GET',AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/LogOut',customHeaders,null,
           ***  (logoutUrl:string) *** => {abp.auth.clearToken();abp.auth.clearRefreshToken();
                new LocalStorageService().removeItem(AppConsts.authorization.encrptedAuthTokenName);
                if (reload !== false) {if (returnUrl) {location.href = returnUrl;} else {location.href = '';}}
            *** location.href = logoutUrl;} ***            

I still don't know how to send the request to the external server Logout Endpoint as I asked in both previous questions.

        public string SendLogout()
        {
            var issuer = ProviderInfo.AdditionalParams["LogoutUrl"];
            var configurationManager = new ConfigurationManager<OpenIdConnectConfiguration>(
                issuer + "/.well-known/openid-configuration",
                new OpenIdConnectConfigurationRetriever(),
                new HttpDocumentRetriever());
                //var validatedTokenResult = await ValidateToken(token, issuer, configurationManager);

            ***return "THE URL FROM THE LOGOUT REQUEST GOES HERE BUT HOW DO I SEND THE REQUEST?"; ***
        }

thank you

The goal is to just logout the user from the auth server that logged them in to the app.

I created the path to the .well-known/openid-configuration using the same method that the login request is handled.
ValidateToken doesn't seem like the right way to send the token. Is there some other method for making the request?

    public async void SendLogout(string token)
    {
        var issuer = ProviderInfo.AdditionalParams["LogoutUrl"];
        var configurationManager = new ConfigurationManager&lt;OpenIdConnectConfiguration&gt;(
            issuer + "/.well-known/openid-configuration",
            new OpenIdConnectConfigurationRetriever(),
            new HttpDocumentRetriever());
        var validatedTokenResult = await ValidateToken(token, issuer, configurationManager);
    }

We are using combined Angular + .net5 version 10.1.

We are connecting to our client's OpenId Connect server for authentication. We recently added a routine for authorization to synchronize roles and organizations. We have now been asked to send a logout request to the auth server when the user logs out of our application. I assume this would entail sending a token to the logout endpoint. AspNetZero does not seem to have an external logout.

I added a parameter to the "OpenId" section of appSettings.json for "UserLogoutEndpoint": "https://..." I am, however, lost as to how to have the application send the request to that endpoint.

thanks for any help you can provide on sending a logout request to an OpenId Connect endpoint.

I recently had this error. the error means that your Angular app did not compile properly. when publishing to Azure, AOT is on for optimization but off for running locally. For us, there were Angular errors, mostly html controls bound to functions that did not exist in the corresponding TypeScript file, that broke the build for publishing to Azure. Once we fixed the bindings, the app published and ran fine.

hope this helps.

Answer

Of course. Obvious once you pointed it out. Thank you!

As a test, I added:

this.\_utilsService.setCookieValue(abp.multiTenancy.tenantIdCookieName,"2");

in:

openIdConnectLoginCallback(resp) {this.initExternalLoginProviders(() => { }

It looks like it's doing exactly what I need!

Thank you!

Showing 21 to 30 of 38 entries