Hi,
I have a simple application that uses a couple of auth providers configured as follows:
public override void Configure(Container container)
{
container.Register<IDbConnectionFactory>(_ => new OrmLiteConnectionFactory(
ConfigUtils.GetConnectionString("default"), MySqlDialect.Provider)
);
container.Register<ICacheClient>(_ => new MemoryCacheClient());
Plugins.Add(new AuthFeature(
() => new AuthUserSession(),
new IAuthProvider[]
{
new ApiKeyAuthProvider(appSettings) { InitSchema = true },
new CredentialsAuthProvider(appSettings),
new JwtAuthProvider(appSettings),
new FacebookAuthProvider(appSettings),
new TwitterAuthProvider(appSettings),
new GoogleOAuth2Provider(appSettings),
}
));
Plugins.Add(new RegistrationFeature());
var repository = new OrmLiteAuthRepository(container.Resolve<IDbConnectionFactory>())
{
UseDistinctRoleTables = false,
};
repository.InitSchema();
container.Register<IAuthRepository>(repository);
}
I invoke /register service to create a new user admin, I get back UserId = 1 (UserAuth table). In my case FirstName = LastName = admin.
Then I invoke /auth/facebook; I’m expecting to see a new user in UserAuth table but the last auth request overwrite data of user 1. Note that I clear all cookies in order to avoid to share the same session.
What I’m doing wrong?
Thank you