Per Malmberg - 503 - Jan 12, 2014

Hello,

Another SS3 to SS4 upgrade issue, this time relating to authentication. I’ve got a NoAuthProvider(), with a minimal implementation (both IsAuthorized and Tryauthenticate returns true) which is registered as follows in AppHost.Configure(…), 

Plugins.Add( new AuthFeature( () => new AuthUserSession(),
new AuthProvider[] { new NoAuthProvider() } ) );

…all according to the docs here: https://github.com/ServiceStack/ServiceStack/wiki/Authentication-and-authorization

Since updating to SS4, I’m now getting the following exceptions:

System.ArgumentException: Type ServiceStack.Auth.AuthenticateService is not a Web Service that inherits IService
   at ServiceStack.Host.ServiceController.RegisterService(Type serviceType)

System.ArgumentException: Type ServiceStack.Auth.AssignRolesService is not a Web Service that inherits IService
   at ServiceStack.Host.ServiceController.RegisterService(Type serviceType)

System.ArgumentException: Type ServiceStack.Auth.UnAssignRolesService is not a Web Service that inherits IService
   at ServiceStack.Host.ServiceController.RegisterService(Type serviceType)

I see no mention in the release notes about any changes to this, but I’m obviously missing something, but what?

The source for NoAuthProvider is available here: https://dl.dropboxusercontent.com/u/9476016/NoAuthProvider.cs

Thanks in advance,

Per

The IService is an interface marker for auto-wiring web services, it shouldn’t be applied to AuthProviders, just web services. But AuthenticateService and AssignRolesService  are Services so that shouldn’t be an issue, but the NoAuthProvider might be causing issues, can you remove the IService off that and let me know if it’s still an issue?

Per Malmberg:

Hm, not sure how IService got in there, but removing it didn’t help unfortunately.

ok just found a bug that was incorrectly logging false exceptions on this, just cutting out a new version now, will let you know when it’s available on MyGet. 

Note: it shouldn’t have any affect on existing functionality, it was just logging errors incorrectly.

+Per Malmberg ok the new dlls were just published to MyGet, it’s still at v4.06 so you might need to remove the old ones to upgrade to the latest dlls

Per Malmberg:

Exceptions gone :slight_smile:
Thanks, +Demis Bellot