Is there a simple way to persist all Windows user names that access my service using AspNetWindowsAuthProvider?
Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] { new AspNetWindowsAuthProvider(this) { PersistSession = true, AllowAllWindowsAuthUsers = true, LoadUserAuthFilter = LoadUserAuthInfo } } ));
I think in a previous version it would do this automatically, but my reading of the Authentication & Authorization docs indicates that the windowsauth no longer persists to the UserAuth table.
Ideally I would like to allow all Windows authenticated users to access my service and be automatically registered in the UserAuth table so that these can be used to assign roles and monitor who is accessing the service.
That sounds like it will do perfectly, but I am getting System.NullReferenceException: 'Object reference not set to an instance of an object.' on the authRepo.SaveUserAuth(session); line.
Am I missing something obvious?
StackTrace " at ServiceStack.Auth.OrmLiteAuthRepositoryBase`2.<>c__DisplayClass25_0.<SaveUserAuth>b__0(IDbConnection db)\r\n at ServiceStack.Auth.OrmLiteAuthRepository`2.Exec(Action`1 fn)\r\n at Grip.AppHost.<>c.<Configure>b__1_4(IRequest req, IPrincipal principal, IAuthSession session) in C:\\Code\\mapdojo\\Grip\\Grip\\Grip\\AppHost.cs:line 145\r\n at ServiceStack.Auth.AspNetWindowsAuthProvider.Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)\r\n at ServiceStack.Auth.AuthenticateService.Post(Authenticate request)\r\n at ServiceStack.Auth.AspNetWindowsAuthProvider.PreAuthenticate(IRequest req, IResponse res)\r\n at ServiceStack.AuthenticateAttribute.PreAuthenticate(IRequest req, IEnumerable`1 authProviders)\r\n at ServiceStack.AuthenticateAttribute.<ExecuteAsync>d__12.MoveNext()" string