reactjs - 3 legged OAuth with React and Redux -


what's accepted method of authenticating oauth2 in react using redux?

my current setup involves wrapping react-router components using redux-auth-wrapper, , if user not authenticated, dispatching action makes necessary external url request oauth provider (google in case).

oauth2 requires sending callback url request, i've set react-router url endpoint/component that, when oncomponentdidmount fires, dispatches actions parse returned hash comes oauth provider, store data in redux store, , redirect user page requested, stored in state parameter of oauth request.

this seems hacky. difficult manage oauth2 callback url between production , development environments. have slick oauth2 workflow working?

p.s. need auth token client can used make client side api requests use token check user has access resources.

i've come better solution involves opening new window oauth login form, polled parent window see if has redirected callback url. once has, can capture child window url hash contains oauth token information in parent window , close child window. can parse hash out , add applications state.

this tutorial particularly helpful.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -