dtbc37573 2011-10-01 11:10
浏览 209
已采纳

检索Steam帐户的OpenID数据,返回null?

I'm using Light-OpenID for PHP to authenticate and retrieve data.

For my OpenID provider URL I am using http://steamcommunity.com/openid/, as documented here-

Steam OpenID Provider Steam can act as an OpenID provider. This allows your application to authenticate a user's SteamID without requiring them to enter their Steam username or password on your site (which would be a violation of the API Terms of Use.) Just download an OpenID library for your language and platform of choice and use http://steamcommunity.com/openid as the provider. The returned Claimed ID will contain the user's 64-bit SteamID. The Claimed ID format is: http://steamcommunity.com/openid/id/

I have specified my required array of data that I am requesting as such -

$openid->required = array(
                        'namePerson',
                        'namePerson/first',
                        'namePerson/last',
                        'namePerson/friendly',
                        'contact/email',
                        'email');

I have made sure my code works, have tested it with other providers such as Google and Yahoo.

I try to login using Steam, I am authenticated, yet when I want to retrieve data about the user using $openid->getAttributes(); the array returns empty.

I have investigated more, and it appears Steam also serves data through its Web API using GetPlayerSummaries. I suppose I could use the 64BIT Steam ID from the authorization of the OpenID account to request the data, but this would require an API key, and parsing the data in PHP.

Is there a way to request this data using OpenID? Or do I have to manually parse everything through Steam's API?

  • 写回答

1条回答 默认 最新

  • douya2982 2011-10-01 11:33
    关注

    Steam can act as an OpenID provider. This allows your application to authenticate a user's SteamID without requiring them to enter their Steam username or password on your site (which would be a violation of the API Terms of Use.)

    This answers a part of your question? They use openId only for authentication - nothing more. In answer on other part i should say - yes you should obtain service key from steam and use GetPlayerSummaries method to get what you want. The parsing will be not problem because they support much formats for return (i would use JSON).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题