It doenst work for me... Did you change anything?
If I understand correctly, the Identity server have the tenants and also the connections strings.
I can expose the data for the tenant's Id(using an endpoint) and then use CurrentTenant.Change
so I can have the connections string for that tenant.
But in that case, my Background Module will connect directly to the database. I don't want that.
Instead, I want to connect my background service to an API.
Is this approach supportable with CurrentTenant.Change
or the ABP has another approach?
hi BernardoTeixeira
Please share the steps? btw, Why are you using module templates?
My steps was https://docs.abp.io/en/abp/latest/Background-Jobs and also this -> https://docs.abp.io/en/abp/latest/Background-Jobs-Hangfire, I just want register background services and make recurring job.
Because I want to isolate the Background services.
I sent you an invitation for github
hi @BernardoTeixeira
Can you explain your use case?
I want to know the best approach to use Hangfire with multi tenant. Because I want to isolate all the backgrounds services, a solution just for background services.
Hi,
Because of the login, we are trying a different approach. But I have some problems. I created a module abp But i don't to use the IdentityServer Module. I want to use the abp App IdentityServer
I already change the module appsettings and the App appsettings, but every request I make, the module give me an error. Saying "Cannot open database "ModuleTest_Main" requested by the login. The login failed."
How can I fix this? (without using a Gateway)
About the identity server/oauth2
Logs -> [17:27:05 INF] Request starting HTTP/1.1 POST https://localhost:44342/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3DPower_BI3%26response_type%3Dcode%26scope%3DApplication%26state%3D40807f79-bbdc-4b9b-b908-12e9087cd410%26redirect_uri%3Dhttps%253A%252F%252Foauth.powerbi.com%252Fviews%252Foauthredirect.html application/x-www-form-urlencoded 554
[17:27:05 INF] Executing endpoint '/Account/Login'
[17:27:05 INF] Route matched with {page = "/Account/Login", area = "", action = "", controller = ""}. Executing page /Account/Login
[17:27:05 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy
[17:27:09 INF] Executing handler method Volo.Abp.Account.Public.Web.Pages.Account.LoginModel.OnPostAsync - ModelState is Valid
[17:27:11 WRN] Ldap login feature is not enabled!
[17:27:12 DBG] Augmenting SignInContext
[17:27:12 DBG] Adding idp claim with value: local
[17:27:12 DBG] Adding auth_time claim with value: 1612200432
[17:27:12 INF] AuthenticationScheme: Identity.Application signed in.
[17:27:12 DBG] Added 0 entity changes to the current audit log
[17:27:12 DBG] Added 0 entity changes to the current audit log
[17:27:12 INF] {"Username": "admin", "Provider": null, "ProviderUserId": null, "SubjectId": "85c51e39-c50f-cf82-1dc4-39fa3d73bbf1", "DisplayName": "admin", "Endpoint": "UI", "ClientId": null, "Category": "Authentication", "Name": "User Login Success", "EventType": "Success", "Id": 1000, "Message": null, "ActivityId": "80000407-0006-fe00-b63f-84710c7967bb", "TimeStamp": "2021-02-01T17:27:12.0000000Z", "ProcessId": 31944, "LocalIpAddress": "::1:44342", "RemoteIpAddress": "::1", "$type": "UserLoginSuccessEvent"}
[17:27:12 INF] Executed handler method OnPostAsync, returned result Microsoft.AspNetCore.Mvc.RedirectResult.
[17:27:12 DBG] Added 0 entity changes to the current audit log
[17:27:12 INF] Executing RedirectResult, redirecting to /connect/authorize/callback?client_id=Power_BI3&response_type=code&scope=Application&state=40807f79-bbdc-4b9b-b908-12e9087cd410&redirect_uri=https%3A%2F%2Foauth.powerbi.com%2Fviews%2Foauthredirect.html.
[17:27:12 INF] Executed page /Account/Login in 7615.2262ms
[17:27:12 INF] Executed endpoint '/Account/Login'
[17:27:13 DBG] Added 0 entity changes to the current audit log
[17:27:13 DBG] Added 0 entity changes to the current audit log
[17:27:13 INF] Request finished in 7909.3346ms 302
[17:27:13 INF] Request starting HTTP/1.1 GET https://localhost:44342/connect/authorize/callback?client_id=Power_BI3&response_type=code&scope=Application&state=40807f79-bbdc-4b9b-b908-12e9087cd410&redirect_uri=https%3A%2F%2Foauth.powerbi.com%2Fviews%2Foauthredirect.html
[17:27:15 DBG] Request path /connect/authorize/callback matched to endpoint type Authorize
[17:27:15 DBG] Endpoint enabled: Authorize, successfully created handler: IdentityServer4.Endpoints.AuthorizeCallbackEndpoint
[17:27:15 INF] Invoking IdentityServer endpoint: IdentityServer4.Endpoints.AuthorizeCallbackEndpoint for /connect/authorize/callback
[17:27:15 DBG] Start authorize callback request
[17:27:15 DBG] User in authorize request: 85c51e39-c50f-cf82-1dc4-39fa3d73bbf1
[17:27:15 DBG] Start authorize request protocol validation
[17:27:15 DBG] client configuration validation for client Power_BI3 succeeded.
[17:27:15 DBG] Checking for PKCE parameters
[17:27:15 DBG] No PKCE used.
[17:27:15 DBG] Calling into custom validator: IdentityServer4.Validation.DefaultCustomAuthorizeRequestValidator
[17:27:15 DBG] ValidatedAuthorizeRequest
{"ClientId": "Power_BI3", "ClientName": "Power_BI3", "RedirectUri": "https://oauth.powerbi.com/views/oauthredirect.html", "AllowedRedirectUris": ["https://oauth.powerbi.com/views/oauthredirect.html"], "SubjectId": "85c51e39-c50f-cf82-1dc4-39fa3d73bbf1", "ResponseType": "code", "ResponseMode": "query", "GrantType": "authorization_code", "RequestedScopes": "Application", "State": "40807f79-bbdc-4b9b-b908-12e9087cd410", "UiLocales": null, "Nonce": null, "AuthenticationContextReferenceClasses": null, "DisplayMode": null, "PromptMode": null, "MaxAge": null, "LoginHint": null, "SessionId": "rTCbKfv_AjNcLbCnDBS8SA", "Raw": {"client_id": "Power_BI3", "response_type": "code", "scope": "Application", "state": "40807f79-bbdc-4b9b-b908-12e9087cd410", "redirect_uri": "https://oauth.powerbi.com/views/oauthredirect.html"}, "$type": "AuthorizeRequestValidationLog"}
[17:27:15 DBG] Client is configured to not require consent, no consent is required
[17:27:15 DBG] Creating Authorization Code Flow response.
[17:27:16 INF] {"ClientId": "Power_BI3", "ClientName": "Power_BI3", "RedirectUri": "https://oauth.powerbi.com/views/oauthredirect.html", "Endpoint": "Authorize", "SubjectId": "85c51e39-c50f-cf82-1dc4-39fa3d73bbf1", "Scopes": "Application", "GrantType": "authorization_code", "Tokens": [{"TokenType": "code", "TokenValue": "****SmUE", "$type": "Token"}], "Category": "Token", "Name": "Token Issued Success", "EventType": "Success", "Id": 2000, "Message": null, "ActivityId": "80000408-0006-fe00-b63f-84710c7967bb", "TimeStamp": "2021-02-01T17:27:16.0000000Z", "ProcessId": 31944, "LocalIpAddress": "::1:44342", "RemoteIpAddress": "::1", "$type": "TokenIssuedSuccessEvent"}
[17:27:16 DBG] Authorize endpoint response
{"SubjectId": "85c51e39-c50f-cf82-1dc4-39fa3d73bbf1", "ClientId": "Power_BI3", "RedirectUri": "https://oauth.powerbi.com/views/oauthredirect.html", "State": "40807f79-bbdc-4b9b-b908-12e9087cd410", "Scope": "Application", "Error": null, "ErrorDescription": null, "$type": "AuthorizeResponseLog"}
[17:27:16 DBG] Augmenting SignInContext
[17:27:16 INF] AuthenticationScheme: Identity.Application signed in.
[17:27:16 INF] Request finished in 3082.3528ms 302
[17:27:16 INF] Request starting HTTP/1.1 POST https://localhost:44342/connect/token application/x-www-form-urlencoded 147
The request ->
client_id = "Power_BI3";
client_secret = "1q2w3E*";
redirect_uri = "https://oauth.powerbi.com/views/oauthredirect.html";
windowWidth = 1200;
windowHeight = 1000;
[DataSource.Kind="NextBITT.Analytics", Publish="NextBITT.Analytics.Publish"]
shared NextBITT.Analytics.Contents = (url as text) =>
let
source = Json.Document(Web.Contents(url))
in
source;
StartLogin = (resourceUrl, state, display) =>
let
AuthorizeUrl = "https://localhost:44342/connect/authorize?" & Uri.BuildQueryString([
client_id = client_id,
response_type = "code",
scope = "Application",
state = state,
redirect_uri = redirect_uri])
in
[
LoginUri = AuthorizeUrl,
CallbackUri = redirect_uri,
WindowHeight = windowHeight,
WindowWidth = windowWidth,
Context = null
];
FinishLogin = (context, callbackUri, state) =>
let
Parts = Uri.Parts(callbackUri)[Query]
in
TokenMethod(Parts[code]);
TokenMethod = (code) =>
let
Response = Web.Contents("https://localhost:44342/connect/token", [
Content = Text.ToBinary(Uri.BuildQueryString([
client_id = client_id,
client_secret = client_secret,
grant_type = "authorization_code",
redirect_uri = redirect_uri])),
Headers=[#"Content-type" = "application/x-www-form-urlencoded",#"Accept" = "application/json"]]),
Parts = Json.Document(Response)
in
Parts;
Am I missig some type of configuration or parameter? (The Power Bi Connector and Power Bi desktop continue to crash)
Hi, when I added that code -> Configure<MvcOptions>(options =>
swagger can't identify the endpoints for odata.