wwwlicious / servicestack-authentication-identityserver

A plugin for ServiceStack and IdentityServer that provides OpenIDConnect / OAuth 2.0 Single Sign-On Authentication
Other
29 stars 15 forks source link

Compatibility with ServiceStack Version 5.4.x #15

Closed akiander closed 5 years ago

akiander commented 5 years ago

I tried using this component in a ServiceStack version 5.4.0 web service and I was not able to use it.

The following code won't compile:

        this.Plugins.Add(new IdentityServerAuthFeature 
        {
            AuthProviderType = IdentityServerAuthProviderType.UserAuthProvider,
            AuthRealm = "http://identityserver:5000/", 
            ClientId = "ServiceStack.SelfHost", 
            ClientSecret = "F621F470-9731-4A25-80EF-67A6F7C5F4B8",              
            Scopes = "openid ServiceStack.SelfHost offline_access"
        });

due to these errors:

1>C:\Code\BITS\DiscountGuidanceService\DiscountGuidanceService\DiscountGuidanceService\AppHost.cs(109,34,109,59): error CS0012: The type 'IAppSettings' is defined in an assembly that is not referenced. You must add a reference to assembly 'ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43'.
1>C:\Code\BITS\DiscountGuidanceService\DiscountGuidanceService\DiscountGuidanceService\AppHost.cs(109,13,109,29): error CS0012: The type 'IPlugin' is defined in an assembly that is not referenced. You must add a reference to assembly 'ServiceStack, Version=4.0.56.0, Culture=neutral, PublicKeyToken=null'.

I tried downgrading ServiceStack to version 4.x to support this component but then other areas of the service code begin to fail.

Is there some simple way to get this Identity Server authentication working on version 5.4.x?

nover commented 5 years ago

@wwwlicious would you be interested in a PR fixing this? I'm currently working in a fork to bring this up to 5.4 as I need it in a project.

It requires retargeting to netstandard2.0 and dotnet framework 4.6.2.

wwwlicious commented 5 years ago

@nover sure, a PR would be most welcome. 👍