GrantType Resource Owner Password not allowed

I’m using AuthenticationApi Resource Owner Flow for authenticating user as shown in below code.

var result = await
client.GetTokenAsync(new
ResourceOwnerTokenRequest
            {
                ClientId = _auth0Settings.ClientId,
                ClientSecret = _auth0Settings.ClientSecret,
                Audience = _auth0Settings.ApiIdentifier,
                Scope = scope + " all",
                Realm = connection,
                Username = loginViewModel.EmailAddress,          

                Password = loginViewModel.Password,
            });
            var access_token = result.AccessToken;

I was able to get access_token successfully while using old Auth0 account created at 28/05/2017, but while using same code with new Auth0 account + newly created users, I am getting an error:

Grant type ‘http://auth0.com/oauth/grant-type/password-realm’ not allowed for the client.

According to this post, by using Management Api I can add grant-type to given client. But question is how to do so?

Your post does not provide any specific question to answer. But question is how to do so? - do you mean what endpoint to call, what request body, etc? The post you referenced provides the necessary info - Please read through the links provided in there.

http://community.auth0.com/questions/3944/error-grant-type-password-not-allowed-for-the-clie

Your post does not provide any specific question to answer. But question is how to do so? - do you mean what endpoint to call, what request body, etc? The post you referenced provides the necessary info - Please read through the links provided in there.

http://community.auth0.com/questions/3944/error-grant-type-password-not-allowed-for-the-clie

Also have in mind that grant types can now also be managed through the Dashboard by going to the client application advanced settings.