Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roles #4

Open
bluee opened this issue May 21, 2015 · 8 comments
Open

Roles #4

bluee opened this issue May 21, 2015 · 8 comments

Comments

@bluee
Copy link

bluee commented May 21, 2015

In the instructions it says to remove ApplicationDbContext, but how would one add roles? Anyone who have a snippet. All of the existing sample implements using ApplicationDbContext:

    public class ApplicationRoleManager : RoleManager<IdentityRole>
    {
        public ApplicationRoleManager(IRoleStore<IdentityRole, string> store)
            : base(store)
        {
        }
        public static ApplicationRoleManager Create(IdentityFactoryOptions<ApplicationRoleManager> options, IOwinContext context)
        {
            var roleStore = new RoleStore<IdentityRole>(context.Get<AuthenticationDbContext>());
            return new ApplicationRoleManager(roleStore);
        }
    }
@JasonColeyNZ
Copy link

Did you figure this out, I have tried

var appRoleManager = new ApplicationRoleManager(new MySqlRoleStore());
return appRoleManager;

Which works for creating but it seems a lot of functions don't work, FindByIdAsync doesn't seem to work, CreateAsync works fine, and it seems Roles is not implemented at all, which makes a lot of examples out there no good whatsoever?

@radenkozec
Copy link
Owner

@JasonColeyNZ Some issues are fixed but I haven't got a time to re-publish updated NuGet package.
You can try to pull latest version code and build it locally or wait for few days until I re-publish latest version of NuGet package.Thanks.

@cedisoftsrl
Copy link

Thank you

@JasonColeyNZ
Copy link

OK I got the roles working from the latest code, thank you.

Now can we add claims using this API yet or is this not finished?

Just trying to figure out how to add other fields, like First Name, Last Name etc?

Actually I think I have this sorted now, just needed to do a bit more research

@radenkozec
Copy link
Owner

@JasonColeyNZ I think you need to extend identity implementation to add more fields. Not sure about claims.

@cmjchrisjones
Copy link

@JasonColeyNZ Would you be able to share the steps you used to get roles working please. I'm now trying to implement the same using MySQL and being relatively new to C# / ASP.NET I'm struggling a little ;)

@msx752
Copy link

msx752 commented Apr 9, 2016

hello, i started to use mysql database.when i search the resource about mysql, i found your project.
its really good resource.
if you interest i created roles and users manager.
#10

@tdoumas
Copy link

tdoumas commented Dec 22, 2017

I know it's been a long time since the last commit, but nuget package is still outdated. @radenkozec any plans to re-publish latest code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants