Base solution for your next web application

Activities of "henryand"

Has this issue been resolved? I am having the same problem.

We were able to track down the root cause this morning by turning off strict templates and fulltemplattypecheck in tsconfig. This allowed us to see some old code that was not strictly typed which did not meet the upgrade standards. we then deleted the offending code since we no longer used it anyway. we turned the compiler options back to true and we are published!

"angularCompilerOptions": { "fullTemplateTypeCheck": false, "strictTemplates": false,

hope this helps others if they get the same error.

thanks!

we found and corrected our problem. we had code that failed "aot" during build optimization.

the npm-put error for "abp-zero-template" pointed us to our angular.json file that has that template. the production config for that template was configured with a different "aot" setting, which is why it only crashed on publish.

this issue is still open so I hope this answer helps if @Tachyon is still having issues.

Will adding "Abp.TenantID=2" in the querystring automatically update the AbpSession.TenantId? Are there any code changes I will need to make in order to use that querystring value?

I know this will tell the TokenAuthController what the tenantId should be, but AbpSession value is hardcoded into various functions used during the external authentication and authorization process. If it isn't in AbpSession,then it doesn't really help. One example: GetRoleByNameAsync(String roleName) does not have an override to allow me to pass in a tenantID - it is hardcoded to use AbpSession.TenantId. That may be by design, but I need this during external login for authorization validation so I need an override or I need the correct AbpSession.TenantID. Another example is SetRolesAsync(user, rolename) which only looks up the role for the AbpSession.TenantId. Another example during external login is GetTenancyNameOrNull() uses AbpSession.TenantId.

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!

Answer

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

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.

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<OpenIdConnectConfiguration>(
            issuer + "/.well-known/openid-configuration",
            new OpenIdConnectConfigurationRetriever(),
            new HttpDocumentRetriever());
        var validatedTokenResult = await ValidateToken(token, issuer, configurationManager);
    }
  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

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

thanks

Showing 1 to 10 of 19 entries