Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jan 19, 2016

No description provided.

@ghost
Copy link
Author

ghost commented Jan 27, 2016

Hmmm ... I am not a specialist, but wouldn't asking the user to provide account name / password exclude other kinds of OAuth-based authentication methods?

@Nemikolh
Copy link
Contributor

Not really, this could be added later: see for example this.
This is one of the nice things with passportjs. 😃

@@ -0,0 +1,159 @@
# RSP - 1 — *bz* REST API

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should mention that everything should be prefixed by something like /api/v1/bz. If you agree to this convention (obviously). Note that @Vaelden added this to the top of his RSP regarding the lycan API.

@ghost
Copy link
Author

ghost commented Mar 29, 2016

It feels like something is missing from this specification: how exactly do you handle authentication?

Do you just have a parameter for each request, something like ?private_token=fa56974353e967b1db93c116df4872a15cbecb9b? In that case, shouldn't it be returned in the POST /login request?

200 | Success
400 | Error in request body
403 | This account is already connected
404 | No account for the given url
Copy link

Choose a reason for hiding this comment

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

Returning a different error code when an account does not exists and when an account exists but the password is incorrect leaks some information that an attacker could use to first find a correct account name, and then do password attacks on it. I would prefer if we just have an error code for "username or password incorrect". Github uses 401 Unauthorized for this purpose.

@lthms
Copy link

lthms commented May 27, 2016

I hope I will have time this weekend to address these remarks and update both the RSP and the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants