openid php steam,steam-openid

Provides an interface for sign into 3d-party sites using Steam OpenID

Steam OpenID Web Login

Installation

It's so easy!

npm i steam-openid

Version Support

Support for versions of node.js will follow that of the request module.

Usage

import SteamOpenID from "steam-openid";

import SteamCommunity from "steamcommunity";

const openid = new SteamOpenID();

const community = new SteamCommunity();

community.login(

{

accountName: "username",

password: "password",

disableMobile: true

},

(error, sessionID, cookies) => {

if (error) throw error;

openid.setCookies(cookies);

}

);

// openid.loginWeb("https://steamcommunity.com/openid/login?openid.mode=checkid_setup&...")

openid

.loginWeb("https://csgo500.com/steam/preauth")

.then(response => console.log(response.body, response.headers, response.href, response.cookies, response.jar))

.catch(console.error);import SteamOpenID from "steam-openid";

const cookies = ["steamLoginSecure=76561198036081043%7C%7C0BF6C9BA765B006800DE2319B920A5371063F0CC", "sessionid=290eb6ead617308c28811463"];

openid.setCookies(cookies);

openid

.loginWeb("https://csgo500.com/steam/preauth")

.then(({ cookies }) => console.log(cookies))

.catch(console.error);Methods

constructor([options])

options - Optional. request options

setCookies(cookies)

cookies - An array of cookies (as name=value pair strings)

loginWeb(uri, [cloneJar])

cloneJar - Optional. By default(true) will use a copy of .jar to prevent crossing cookies

Returns

{

body: String,

headers: String[],

href: String,

jar: RequestJar,

cookies: Object

}

It's better not to use jar instance due to crossing cookies

{ cookies } includes cookies from Steam domains only if cloneJar is false

getLoginForm(uri, jar)

uri - Check the usage of .loginWeb(uri, ...)

jar - RequestJar with Steam cookies

Returns

{

uri: String,

data: Object

}

It's better to use .loginWeb(...)

processLoginForm(uri, formData, jar)

uri - It must be https://steamcommunity.com/openid/login, however Steam can change it in future

formData - Serialized form #loginForm

jar - RequestJar with Steam cookies

Returns

{

body: String,

headers: String[],

href: String,

}

It's better to use .loginWeb(...)

Development

npm run clean - Remove lib directory

npm run test - Run tests

npm run build - Babel will transpile ES6 => ES5 and minify the code.

npm run prepare - Hook for npm. Do all the checks before publishing module.

License

Released under MIT license

HomePage

Repository

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值