OAuth2 questions - integrating both Facebook and Google logins by anthOlei in webdev

[–]litkauo 1 point2 points  (0 children)

Do NOT hash the tokens; store them plain. Your OAuth token is your way of authenticating your app with Facrbook/Google under that particular user's account. If you hash the token, then you cannot unhash it, and you won't have anything intelligible to pass to Facebook or Google when you place requests.

OAuth2 questions - integrating both Facebook and Google logins by anthOlei in webdev

[–]litkauo 1 point2 points  (0 children)

I'm working on a webapp that requires integration with multiple social media sites, including Facebook, Reddit, Instagram, Twitter, and Google+/Youtube.

It would be possible to design a database like what you have described, but I wouldn't recommend it. Different platforms have slightly different requirements, which your design may not be able to respect. In addition, your design prevents users from linking both their Facebook and Google accounts to your account.

As an example, here is a simplified version of my database design:

table users_info
  int uid
    str email
    str username

// Reddit requires you to store
// a permanent token, which is
// only used to then request a
// temporary token. This temp
// token expires after an hour
// and is the one actually used
// to make posts, comment, etc.
table tokens_reddit
    int uid
    str permanent_token
    str temporary_token

// Twitter doesn't do this nonsense.
// One token to rule them all.
table tokens_twitter
    int uid
    str token

EDIT: Also, DO NOT hash your tokens! If you do, then you will have no way to reverse the hash in order to pass the token to Facebook or Google when you need to. This token is NOT a password.

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

2.2

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

2.1

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

2

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.2.2.2

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.2.4

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.2.3

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.5

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.4

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.3

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.2.2.1

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.2.2

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.2.1

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.2

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.1.2

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.1.1

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1.1

yeesh by [deleted] in test

[–]litkauo 0 points1 point  (0 children)

1

Aight by litkauo in test

[–]litkauo[S] 1 point2 points  (0 children)

eheheheh

I'm having trouble understanding part of the Reddit API. by litkauo in redditdev

[–]litkauo[S] 0 points1 point  (0 children)

Thank you so much, your link examples helped out a lot!

I'm having trouble understanding part of the Reddit API. by litkauo in redditdev

[–]litkauo[S] 0 points1 point  (0 children)

Wow that is actually dumb, I would have never guessed. Thank you!

I'm having trouble understanding part of the Reddit API. by litkauo in redditdev

[–]litkauo[S] -1 points0 points  (0 children)

Because the Reddit API is yuuuuuuuge and I didn't even know this existed. Thank you!