IdentityModel / IdentityModel.OidcClient.Old

OpenID Connect Client Library for Native Applications
Other
38 stars 17 forks source link

Assistance using OidcClient with Steam OpenID #8

Closed LostLogic closed 8 years ago

LostLogic commented 8 years ago

Hi,

I'm having some issues getting the OidcClient to work with Steam OpenID. I've confirmed that it works by using the sample server, but when I try playing with Steam, I'm stumped...

The webview is a clean copy-paste with just namespace changes from the sample - https://github.com/IdentityModel/IdentityModel.OidcClient.Samples/blob/master/Uwp/UwpSample/UwpWebView.cs

                string SteamSecret = "plaintextsecret"; 

                var webView = new UwpWebView(enableWindowsAuthentication: false);
                var authority = "https://steamcommunity.com/openid";
                var options = new OidcClientOptions(
                    authority: authority,
                    clientId: "MyAmazing-Win10",
                    clientSecret: SteamSecret,
                    scope: "openid",
                    redirectUri: "https://www.mydomain.com/auth/steam/return",
                    webView: webView);

                var client = new OidcClient(options);
                var result = await client.LoginAsync();

This results in an exception - Exception thrown: 'Newtonsoft.Json.JsonReaderException' - "Unexpected character encountered while parsing value: <. Path '', line 0, position 0."

Changing the authority to the login url provided in the XML from the authority page, https://steamcommunity.com/openid/login results in another exception: System.Net.Http.HttpRequestException - {"The text associated with this error code could not be found.\r\n\r\nA redirect request will change a secure to a non-secure connection\r\n"}

Any idea what I am doing wrong here? Or is it the Steam OpenID implementation that's acting up.

UAP, Win 10, C#.

leastprivilege commented 8 years ago

I don't think Steam is using OpenID Connect - but rather OpenID 2.0 - which is completely different.

LostLogic commented 8 years ago

Ah, I see. I've since managed to get it to work, but with WebAuthenticationBroker. Thank you for your reply Dominick.