Base solution for your next web application

Activities of "tteoh"

Answer

<cite>aaron: </cite> You need Abp.EntityFramework v2.3.0, which should be compatible with ASP.NET Zero v4.0 to v4.4. ASP.NET Zero v4.5 to v4.6 should use Abp.EntityFramework v3.1.2.

Hi aaron,

Which version should I upgrade to if I'm using MVC5AJ1? Because I'm not able to upgrade to the latest version, which is version 3.2.3 due to my .NETFramework is 4.6.1

Thanks. /Tommy

<cite>ismcagdas: </cite> Thanks for sharing it here @tteoh :)

You're welcome :D

Thanks. /Tommy

<cite>ismcagdas: </cite> Hi @tteoh,

Can you explain how do you prevent multiple logins ? We can suggest somnething accordingly.

Thanks.

Hi @ismcagdas,

This: [https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=6729&p=22492#p22492])

Thanks. /Tommy

This problem is fixed. Please go to the link below to check how is it being fixed.

[https://github.com/aspnetboilerplate/module-zero/issues/413])

Hope this might help those people who is trying to do prevent multiple login as well. Feel free to ask me if you have any problem and I will try my best to help.

Thanks. /Tommy

Hi,

I'm doing prevent multiple login and it's working fine now. But I've a question about it, which is can I prevent the multiple login no matter it's from browser or other agents (such as Postman)?

Thanks. /Tommy

This problem is fixed. Please go to the link below to check how is it being fixed.

[https://github.com/aspnetboilerplate/module-zero/issues/413])

Hope this might help those people who is trying to do prevent multiple login as well. Feel free to ask me if you have any problem and I will try my best to help.

Thanks. /Tommy

<cite>tteoh: </cite> Thanks you ismcagdas, that reply helps us to move on!

The codes below are use to compare the Security Stamps and we are stuck again.

Default data type is string, which is with 2 type parameters:

OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
   validateInterval: TimeSpan.FromMinutes(0),
   regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))

Since that we are using long data type as User PK, so we implemented this, which is with 3 type parameters:

OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<UserManager, User, long>(
   validateInterval: TimeSpan.FromMinutes(0),
   regenerateIdentityCallback: (manager, user) => (user.GenerateUserIdentityAsync(manager)),
   getUserIdCallback: (user) => (long.Parse(user.GetUserId())))

But it's not working. I've tried with ASP.NET MVC project and it's working.

And we saw that most of the ASP.NET MVC examples are with these codes:

app.CreatePerOwinContext(ApplicationDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);

So we are wondering is this the reason why our previous code is not working and do we need to implement this? Or it's implemented by ABP framework already?

Thanks. /Tommy

Dear Support,

Any further guidance on this issue. We suspect CreatePerOwinContext is critical for cookie validation; especially to get an instance of UserManager; otherwise security stamp in cookie and database cannot be compared.

Thanks. /Tommy

Thanks you ismcagdas, that reply helps us to move on!

The codes below are use to compare the Security Stamps and we are stuck again.

Default data type is string, which is with 2 type parameters:

OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
    validateInterval: TimeSpan.FromMinutes(0),
    regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))

Since that we are using long data type as User PK, so we implemented this, which is with 3 type parameters:

OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<UserManager, User, long>(
    validateInterval: TimeSpan.FromMinutes(0),
    regenerateIdentityCallback: (manager, user) => (user.GenerateUserIdentityAsync(manager)),
    getUserIdCallback: (user) => (long.Parse(user.GetUserId())))

But it's not working. I've tried with ASP.NET MVC project and it's working.

And we saw that most of the ASP.NET MVC examples are with these codes:

app.CreatePerOwinContext(ApplicationDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);

So we are wondering is this the reason why our previous code is not working and do we need to implement this? Or it's implemented by ABP framework already?

Thanks. /Tommy

Thank you for the reply, that helped us to have a more understanding about this.

And we found this article that what we wanted: <a class="postlink" href="http://tech.trailmax.info/2015/09/prevent-multiple-logins-in-asp-net-identity/">http://tech.trailmax.info/2015/09/preve ... -identity/</a> We tried to implement this and we're stuck here:

app.UseCookieAuthentication(new CookieAuthenticationOptions
{
    AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
    LoginPath = new PathString("/Account/Login"),
    Provider = new CookieAuthenticationProvider
    {
        OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
            validateInterval: TimeSpan.FromMinutes(0), // <-- Note the timer is set for zero
            regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
    }
    // other settings
});

We are getting error:

OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(

Can you please guide us how to get the 2 objects (ApplicationUserManager & ApplicationUser) from ABP framework?

Another problem is when there are 2 pages open from different browsers, one of the browser is not log out when another browser changed the password

Thanks. /Tommy

I have few problems here due to the findings:

  1. The count of user logged in reduced after 30 secs logged out. Any explanation for this why it reduced the count after 30 seconds logged out instead of immediately?
  2. The count of user logged in is not increasing when I'm using Postman to log in. What if I want to get the count of user logged in without SignalR integration?
  3. ConnectionId is refreshed when the page is refreshed.

Thanks. /Tommy

Showing 81 to 90 of 163 entries