No Gooogle OAuth for .net core?

There doesn’t seem to be any Google OAuth object in ServiceStack.Auth for asp.net core. I added a reference to using ServiceStack.Authentication.OAuth2; but it doesn’t accept the AppSettings object.

It gives me this error:

It gives option to add reference but it doesn’t fix it. I guess it is because IAppSettings is defined somewhere else but I am not really sure. I can pass AppSettings to the Auth providers in the .net core SS project fine.

What is proper was to use Google auth provider in .net core?

The OAuth2 providers have a dependency DotNetOpenAuth which does not support .NET Core.

There is no Google AuthProvider available for .NET Core yet. Vote for this feature request to get notified when one is available.

Is there any workaround to get google login working?

A Google OAuth Provider is required to Authenticate with Google OAuth, one needs to be written by either us or the community. If you vote for the feature request it will notify you when one is available.

Is OpenId working in .net core?

No it also depends on DotNetOpenAuth.

FYI, I’ve created a new GoogleAuthProvider in this commit which doesn’t have the DotNetOpenAuth dependency.

To use the new provider you’ll need to use oauth.google.* in your appsettings.json, e.g:

/* Create App https://console.developers.google.com/apis/credentials */
"oauth.google.ConsumerKey": "...",
"oauth.google.ConsumerSecret": "...",

and your Google OAuth App will need to redirect to /auth/google redirect url.

These changes are available from v5.2.1 that’s now available on MyGet.

I’ve also updated the SimpleAuth.Mvc project to use the new GoogleAuthProvider and deployed a working example at: http://mvc.netcore.io

2 Likes