Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to securely implement oauth in react-fusionauth?


Asked by Dillon Ho on Dec 08, 2021 React



The only configurations you need to change are Authorized redirect URLs and Logout URL on the OAuth tab. These are basically links used by FusionAuth during the only two times we redirect off our app entirely: login and logout. After a user logs in, FusionAuth will redirect them back to our app on one of the Authorized Redirect URLs.
Besides,
In order to set up FusionAuth, follow the 5-minute setup guide. It is simple and quick. By default, the OAuth server will run at the address http://localhost:9011. In this step, we are going to configure a FusionAuth application. This is different from the FusionAuth server instance or the React Native application.
In fact, The OAuth server generates access tokens which are given to the server. The server stores them securely in the session, and when needed, passes them to other APIs for authorization. This is the architecture we used when securing a React application with OAuuth. However with a mobile device, things change a bit.
Indeed,
In FusionAuth, an application is anything a user might log in to. To configure this, sign into the FusionAuth administrative interface and navigate to “Applications”. From there, create a new application. Once you’ve done that, navigate to the “OAuth” tab and add in a redirect URI of fusionauth-demo:/oauthredirect.
In addition,
We’ll use FusionAuth for auth, but the React Native code should work with any OAuth compliant server. First, we’ll be installing and configuring FusionAuth.