Base solution for your next web application

Activities of "rattlehub"

I have a class called Address. I want to track changes with EntityHistory but I want to not log all the objects. For example is it possible to track changes on certain objects, for example, exclude CreatorUserId etc. It seems I can only add selectors on the class. Configuration.EntityHistory.Selectors.Add("Address", typeof(Address));

Method is purely an example. I want to return 201 for create for angular client without creating a controller

Take the method protected virtual async Task CreateUserAsync(CreateOrUpdateUserInput input)

This returns 200. Is it possible without creating a controller in a service inheriting from ApplicationService to return 201 instead of 200. The services don't follow the correct http status codes as defined here. <a class="postlink" href="http://www.restapitutorial.com/httpstatuscodes.html">http://www.restapitutorial.com/httpstatuscodes.html</a>

Question

When a user tries to activate there email we have a issue where user.EmailConfirmationCode in the ActivateEmail service always returns null calling the user as follows ( var user = await UserManager.GetUserByIdAsync(input.UserId); ), even though i can see the record in the db for the specified userid

Even if i restart the app, its always null so not sure how to solve this.

I created a service to get the encrypted users details and then passed these credentials in the OAuth. I dint want to modify the source in Abp.ZeroCore.IdentityServer4 so i have a workaround thats acceptable. thanks

From what i can work out the logic to pass the user name and password is handled by Abp.ZeroCore.IdentityServer4. The IdentityServerRegistrar class in the Web.Core project seems to map it to the user. Is there anyway i can modify the RequestResourceOwnerPasswordAsync without brining in all the BoilerPlate projects into my project.

No that is via the api, not using IdentityServer and OAuth. Calling it via the api worksbut im trying to use the OAuth client as its set up in the console app.
This line of the code ....await tokenClient.RequestResourceOwnerPasswordAsync("admin", "123qwe", "default-api"); I have looked at every controller and added breakpoints on every login i can find but what Controller does RequestResourceOwnerPasswordAsync even call. It sounds simple but i cant find it. I point the Host server at <a class="postlink" href="http://localhost:22742/">http://localhost:22742/</a>

private static async Task&lt;string&gt; GetAccessTokenViaOwnerPasswordAsync()
{
    var disco = await DiscoveryClient.GetAsync(ServerUrlBase);

    using (var httpHandler = new HttpClientHandler())
    {
        httpHandler.CookieContainer.Add(new Uri(ServerUrlBase), new Cookie(MultiTenancyConsts.TenantIdResolveKey, "1")); //Set TenantId

        var tokenClient = new TokenClient(disco.TokenEndpoint, "client", "def2edf7-5d42-4edc-a84a-30136c340e13", httpHandler);
        var tokenResponse = await tokenClient.RequestResourceOwnerPasswordAsync("admin", "123qwe", "default-api");

        //.RequestResourceOwnerPasswordAsync("bob", "bob", "read write offline_access").Result

        if (tokenResponse.IsError)
        {
            Console.WriteLine("Error: ");
            Console.WriteLine(tokenResponse.Error);
        }

        Console.WriteLine(tokenResponse.Json);

        return tokenResponse.AccessToken;
    }
}

I have worked out the issue. The username is encrypted in the db and so i have to look for the encrypted record. The problem is i cant see which controller gets the authentication. Could you please advise me how to attach to the authenticate request.

To clarify. Do i need to authenticate against the MVC or Host Project as well. Ive only enabled Identity Server on the Host project as i only need it to connect to the API. Also is there a point i can set a breat point to debug. I put a break on every debug point i could find but i get the error almost instantly.

I have logged in to the portal and it works fine but i have enabled the Identity Server to test the console app but keep getting the error {{ "error": "invalid_grant", "error_description": "invalid_username_or_password" }} Any idea how i solve this. The only change i have made was to enable IdentityServer Yet i have double checked the credentials and i can log in. Could it be 2 factor authentication (If so how would we handle this via the API) Thanks

Showing 1 to 10 of 20 entries