node.js - Steam authentication API, passing data back to Angular -
i have problem express(nodejs)/angular web app rely on steam's login authentication. when user clicks "login" he's redirected steam authentication(steam's website), once logged in user redirected specific route on backend called /verify. once user hits /verify there session variables containing necessary user data access. therefore use jwt generate token data send client(angular in case).
the problem sending token frontend(the client) save in local storage.
any highly appreciated! currently, pass token via query string redirect frontend, doesn't seem solution.
maybe should stick server-side sessions , write http routes user data. problem approach once again client unaware when user authenticates himself on backend, since callback triggered on backend.
edit: tried approach, once again unsure of it's right way go both code-wise , security-wise.
- redirect user steam authentication page.
- wait authentication callback on server side, in case hits route '/verify'.
- once @ /verify session cookie set, therefore redirect user angular app specific route called '/login'.
- on /login user requests token based on session cookie on server, token in case json web token(jwt).
- once token saved in local storage redirect user page in angular app.
if wrong way it, please let me know!
Comments
Post a Comment