that automates the process, but does not remove the time to copy all of the files. it seems the files can't be generated in the place where they are expected to be used (./wwwroot/) so i was asking if we could use them where they are generated (./wwwroot/dist/). it seems very odd to me that we publish both the api and the angular to the webserver at the same time but only the api will run after publish. the entire angular app needs to be moved twice - to the correct folder and to azure.
is there a way to define the angular app's root folder as the dist folder?
Could you provide a follow-up here? We also have "Response already started" littering our log files.
the error message references the following line in Startup.cs
app.Use(async (context, next) => { await next(); if (context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value)) { context.Request.Path = "/index.html"; await next(); } });
are there any examples or documentation for having a separate seeders per tenant?
we do have a standard schema across all tenants, but the data is tenant specific. we need a methodology for updating the data in each tenant database when running the backend before the frontend brings up the login screen. that seems like it would be in the seedhelper. I don't want the seedhelper to run against the default host db, it needs to run against the tenant dbs. when my devs are running localhost to their 3 databases (host, tenant1, tenant2) we would want a seedhelper1 to run against tenant1 connectionstring and then run seedhelper2 against tenant2 connectionstring.
or did you mean that the TokenAuthController should just send the LogoutUrl from the configuration file?
thanks
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()
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<OpenIdConnectConfiguration>(
issuer + "/.well-known/openid-configuration",
new OpenIdConnectConfigurationRetriever(),
new HttpDocumentRetriever());
var validatedTokenResult = await ValidateToken(token, issuer, configurationManager);
}
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.
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!
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