Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "lcyhjx"

thanks so much

I also did research through google, but most about how to get token, use token. Did not find out how to let token failure manually. Did a demo by following article, but still did not find out the feature for let token failure manually. <a class="postlink" href="http://bitoftech.net/2014/06/09/angularjs-token-authentication-using-asp-net-web-api-2-owin-asp-net-identity/">http://bitoftech.net/2014/06/09/angular ... -identity/</a>

Hi ismcagdas, Your understanding is right, and thanks for your good solution.
Thanks! And I am still thinking if and how can logout on service side directly. Such as to let the token failure.

My opinion is that this should be done in front-end, for service request, if get a error message code with no user login, then the front-end should catch the error and redirect to the login page to get a new token

Thanks so much! Move following code to PostInitialize, now it works fine. Configuration.Modules.AbpWebApi().HttpConfiguration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new DefaultContractResolver();

Thanks so much! And then my understand is: 1 The permissions will created at each module initialization. 2 The created permissions are stored in memory – a dictionary 3 When get all permissions or check permission, the permission data is come from memory – dictionary 4 The AbpPermission data table is for roe-permission relationship Am I right? Please correct me if I am wrong

Hi ismcagdas,,

I add following following code

Configuration.Modules.AbpWebApi().HttpConfiguration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new DefaultContractResolver();

in WebApiModel.Initialize, and the return response still camelCase, not pascalCase.

Then I write a customerContractResolver for pascalCase, still not work

public class PascalCasePropertyNamesContractResolver : DefaultContractResolver
        {
            public new static readonly PascalCasePropertyNamesContractResolver Instance = new PascalCasePropertyNamesContractResolver();

            protected override string ResolvePropertyName(string propertyName)
            {
                return propertyName.ToPascalCase();           
            }
        }
Configuration.Modules.AbpWebApi().HttpConfiguration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new PascalCasePropertyNamesContractResolver();

Do you know What am i missing?

BTW, my abp version is 1.2.0.0

I have addressed the issue. The root cause is using a incorrect version of MySql.Data.Entity. the latest stable version of MySql.Data.Entity is 6.9.9, so before I use it. But since the abp sample project is using .net framework 4.5.2, so need to use the version 6.8.3 of MySql.Data.Entity. Now it works fine for me.

@wangxiaochen you can debug into XXX..Api.Controllers.AccountController.Authenticate to track what happened, and which statement is executed, the exception is thrown. Also, I am think 8080 port is so general and used by other service.

Thank you !

Showing 1 to 10 of 34 entries