Skip to content

Added OpenID Login - #188

Closed
Revadike wants to merge 1 commit into
DoctorMcKay:masterfrom
Revadike:patch-1
Closed

Added OpenID Login#188
Revadike wants to merge 1 commit into
DoctorMcKay:masterfrom
Revadike:patch-1

Conversation

@Revadike

@Revadike Revadike commented Jan 19, 2018

Copy link
Copy Markdown
Contributor

Usage:

const steamcommunity = require("steamcommunity");
const community = new steamcommunity();
community.login({
    "accountName": "username",
    "password": "password"
}, function(err) {
    console.log(err || "logged in");
    community.openidLogin("https://royalgamer06.ga/barter/?login", function(err, response, data) {
        if (err) return console.log("error:", err);
        console.log(data); // Logged into third party site
    });
});```

Usage:
```const steamcommunity = require("steamcommunity");
const community = new steamcommunity();
community.login({
    "accountName": "username",
    "password": "password"
}, function(err) {
    console.log(err || "logged in");
    community.openidLogin("https://royalgamer06.ga/barter/?login", function(err, response, data) {
        if (err) return console.log("error:", err);
        console.log(data); // Logged into third party site
    });
});```
@Revadike

Copy link
Copy Markdown
Contributor Author

Perhaps out of scope of this module, but personally, I find it a very useful thing, if I need "Sign in through Steam" on a third party website.

@DoctorMcKay

Copy link
Copy Markdown
Owner

I do think this is out of scope. This might be better as its own npm module.

@Revadike

Copy link
Copy Markdown
Contributor Author

It does fit very nicely in the current module with not much code and coded in your style :)

@scholtzm

Copy link
Copy Markdown

I'd say it's only very slightly out of scope but it's a pretty sought out feature from the questions I have seen at /r/SteamBot.

@Royalgamer06

console.log(data); // Logged into third party site

What's inside data?

@Revadike

Copy link
Copy Markdown
Contributor Author

The response HTML body.

@scholtzm

scholtzm commented Jan 20, 2018

Copy link
Copy Markdown

Oops I totally missed the function signature just above: (err, response, data)

This is pretty useful since you can just take the cookies from response object and reuse them on subsequent requests. 👍

Comment thread index.js

SteamCommunity.prototype.openidLogin = function(url, callback) {
var self = this;
self.loggedIn(function(err, loggedIn) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this check could be removed. Let the user handle this on their own.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, the snippet in the first comment makes an unnecessary request since we know for sure we are logged in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got a point. I just wanted it to be robust, but performance is a good quality too.

@Revadike

Copy link
Copy Markdown
Contributor Author

Hey, what if I argue that the OpenID login is a feature of the Steam Community and therefore fits with this project's scope.

@mert574

mert574 commented Jan 30, 2018

Copy link
Copy Markdown
Contributor

I think it is slightly out of scope but it is actually helpful. Having it will not produce much to worry about

@Kladdkaka

Copy link
Copy Markdown

I think it is out of scope, but it is as many other people said, a very useful feature, I would suggest adding it. :)

@Fxlr8

Fxlr8 commented Apr 4, 2018

Copy link
Copy Markdown

Merge this feature, please

@DoctorMcKay DoctorMcKay closed this Nov 5, 2020
@Revadike

Copy link
Copy Markdown
Contributor Author

This is undoubtably a very useful function node-steamcommunity to provide. So, I ask you @DoctorMcKay you perhaps reconsider this PR. Maybe add it in v4.

@Revadike Revadike mentioned this pull request Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants