How to integrate OPENID authentication into RIS api architecture and front-end framework

I am currently creating a site where a user must log in with Steam before they can use the rest of my website. Steam currently only supports OPENID for authentication. The way I did this is in the following steps:

  • The user clicks the "Login with Steam"

  • My frontend is redirecting to steamcommunity.com

  • If the user has successfully logged in, the user's browser should redirect to my server, then I will add the user to the database (if they are not already included) and create a JSON web token and send it back to my front end.

    eg:

    myfrontend.com?token={my_json_web_token}

  • My front end saves this token as a cookie on the client side and with every request to the server I will send the contents of this cookie to the server.

I have already integrated my application, but it is only gaining popularity, so I wonder if it works, how I implemented it.

thank

+4
source share
1 answer

It sounds like the right way.

It should be noted that you want to make sure that you have CSRF protection, since you use cookies, but this is not quite what you asked for.

CSRF Example

0
source

All Articles