This should do it, when you include the correct DotNetOpenAuth.
This is code you would typically put in your Login page, the first if checks whether we have a response from Steam and deals with the response.
The else part makes sets up the request and redirects the user to Steam - steam will then redirect back to this page once the user has logged in on steam.
Unlike other open auth providers, steam does not provide other user information (email, etc...) by sending a claims request with the request - it will only provide a URL in the response.ClaimedIdentifier which is a URL containing the users steam id at the end.
You will have to do the string manipulation to only get the ID if you want.
protected void Page_Load(object sender, EventArgs e)
{
var openid = new OpenIdRelyingParty();
var response = openid.GetResponse();
if (response != null)
{
switch (response.Status)
{
case AuthenticationStatus.Authenticated:
// do success
var responseURI = response.ClaimedIdentifier.ToString();
//"http://steamcommunity.com/openid/id/76561197969877387"
// last part is steam user id
break;
case AuthenticationStatus.Canceled:
case AuthenticationStatus.Failed:
// do fail
break;
}
}
else
{
using (OpenIdRelyingParty openidd = new OpenIdRelyingParty())
{
IAuthenticationRequest request = openidd.CreateRequest("http://steamcommunity.com/openid");
request.RedirectToProvider();
}
}
}