Andrej Naumovski
Andrej Naumovski

Reputation: 573

React.js/Redux OpenID library/example needed (Steam OpenID specifically)

I'm writing a Node/Express REST + React/Redux application which is supposed to use Steam OpenID as the main factor of authentication. I googled for tutorials/libraries/example code for Steam OpenID (or any OpenID for that matter) but I cannot find anything. I looked at https://github.com/lynndylanhurley/redux-auth and the OAuthSignInButton component but for some reason the docs are very confusing to me. I know this is a broad question but if you are familiar with this library, please explain the steps for OpenID authentication, or if you are aware of any other library/examples, refer them to me. Thanks!

EDIT: To clarify the question, I need to provide OpenID authentication client-side, because I am using REST, hence no sessions/states. What I tried so far was the above-mentioned library, however it wouldn't work as it was using a deprecated version of React Router. I later tried setting up the authentication process on the backend and expose an endpoint which I called using fetch but it gave no response and it didn't redirect me at all.

Upvotes: 1

Views: 1725

Answers (1)

Andrej Naumovski
Andrej Naumovski

Reputation: 573

What I ended up doing (and worked for me) was set up the authentication process on the Node backend using Passport and Passport-Steam, then exposing the endpoint, however I set the returnURL of SteamStrategy to a route on my frontend application and handled the OpenID query params in a React Component, then later use the details to generate a JWT token which I use for authentication later on.

Upvotes: 1

Related Questions