OpenID Connect SSO in React-Redux app

后端 未结 1 2055
我寻月下人不归
我寻月下人不归 2021-02-15 00:39

I\'m trying to implement SSO on my React-Redux app using an OpenID-Connect provider. The intent is to protect all components and redirect the user to the Identity Provider\'s l

1条回答
  •  执笔经年
    2021-02-15 00:57

    You are on the right track - redux-oidc manages your Redux state with the login details - the client library that actually manages the JWT (implicit flow), redirecting to the IdentityServer (whichever) login page and returning to your app (the "callback") is oidc-client.

    redux-auth-wrapper is just a HOC (High Order Component) - basically a wrapper to check if the user is authenticated (either in the Redux store or with a custom function) and forward to a login page - in my opinion you do not really need it as redux-oidc already gives you everything you need.

    I personally also implemented an IdentityServer4 - to centrally manage all external providers - and it's been working great so far.

    I would suggest first looking at https://blogs.msdn.microsoft.com/webdev/2017/04/26/the-mvp-show-learns-about-asp-net-identity-server-and-heidelberg/ where the creator of IdentityServer4 is explaining extremely well how the identification works and the flows (implicit vs hybrid). Once you know the Identity basics and how it all hangs together, have a look at the redux-oidc sample (very easy to follow).

    Have fun ;)

    0 讨论(0)
提交回复
热议问题