locked
How to apply OWIN authentication to display Users and User Roles with edit? Why is there no UI RRS feed

  • Question

  • User2142845853 posted

    Using asp.net c# with OWIN and the built in individual account authentication, it has only a partial set of forms to manage a lost password or adding a phone number but nothing for displaying the USERS and associated ROLES

    It would use code like: 

     public ApplicationRoleManager RoleManager
            {
                get
                {
                    return roleManager ?? Context.GetOwinContext().Get<ApplicationRoleManager>();
                }
    }
    
    protected void SomeMethod(args)
    {
        var x = RoleManager.FindByName("Admin").Users;
    
    which returns x[0].RoleId = "fe900f44f.." and x[0].UserId = "ee87c9450a9b..."  hash for userid

    How to just get the following:

    UserName  Email                   Role      (other? date added?)

    zzyzxx        zzyzxx@1.com    Admin   1/25/2019                        EDIT  

    I have tried several ways.  MVC View may be the best since the web forms GridView is so primitive, possibly unchanged since Win95 that it cannot display content unless its inside a disabled dropdown list.

    The project has a working RoleManager/etc

     public void ConfigureAuth(IAppBuilder app)
            {
                // Configure the db context, user manager and signin manager to use a single instance per request
                app.CreatePerOwinContext(ApplicationDbContext.Create);
                app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
                app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
                app.CreatePerOwinContext<ApplicationRoleManager>(ApplicationRoleManager.Create);

    Would like to display it in a nice way with an edit feature

    Friday, February 8, 2019 7:16 PM

All replies

  • User475983607 posted

    rogersbr

    Using asp.net c# with OWIN and the built in individual account authentication, it has only a partial set of forms to manage a lost password or adding a phone number but nothing for displaying the USERS and associated ROLES

    You've been provided this code several times.  

    rogersbr

    I have tried several ways.  MVC View may be the best since the web forms GridView is so primitive, possibly unchanged since Win95 that it cannot display content unless its inside a disabled dropdown list.

    Web Forms has the same capability as MVC in terms of generating HTML.  You're last statement is referring to code written specifically for you as an example with the expectation that you could modify the code to your liking.  This has proven challenging.  However, if you go back to the original thread you will see I updated the UI/code behind to use a label rather than a disabled dropdown. It took only a few lines of very basic code. 

    Friday, February 8, 2019 7:56 PM