Corey Chase
Corey Chase

Reputation: 87

Implementing OpenID in ASP5

I'm attempting to implement Steam OpenID integration into an ASP5/MVC6 site. The existing OpenID libraries do not work with ASP5 as they seem to rely on HttpContext, which doesn't exist.

This is the only compatible library that I can find:

 "Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-beta4",

I've configured it in Startup.ConfigureServices like so:

    public void ConfigureServices(IServiceCollection services)
    {
        ..
        services.ConfigureOpenIdConnectAuthentication(options =>
        {
            options.Authority = "http://steamcommunity.com/openid";
            options.ClientId = "[ClientIDHere]";
        });
    }

and in Startup.Configure:

app.UseOpenIdConnectAuthentication();

My real question is a simple one, how do I actually use this library in my application to create the OpenID requests? Documentation seems non-existent on this library (typical for a beta, of course) and examples are scarce.

Upvotes: 0

Views: 541

Answers (1)

Kévin Chalet
Kévin Chalet

Reputation: 42000

Update: the Steam authentication provider for ASP.NET 5 is now online. You can visit https://github.com/aspnet-contrib/AspNet.Security.OpenId.Providers for more information.


Sadly, Steam relies on OpenID 2.0, which is not (and won't be) supported by ASP.NET 5. Natively, only OAuth2 and OpenID Connect (based on OAuth2 and not on OpenID 2.0) are supported by the default authentication middleware shipped with ASP.NET 5.

I guess you were previously using the Steam provider for OWIN/Katana that was developed by the community: https://github.com/RockstarLabs/OwinOAuthProviders/tree/master/Owin.Security.Providers/Steam Most of these providers - based on OAuth2 - will be ported as part of the aspnet-contrib project: https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers.

Porting the OpenID 2.0 providers is not in the immediate plans, but you can open a new thread on https://github.com/aspnet-contrib/AspNet.Security.OpenId.Providers/issues and vote for the Stream provider.

Upvotes: 1

Related Questions