Getting start
-
npm install
-
Put the
aws-exports.js
undersrc/
-
Change the
oauth
configuration in theApp.js
/App2.js
-
npm start
Different ways using Cognito Hosted UI with Amplify
Using Authenticator/withAuthenticator
You can use withAuthenticator
or Authenticator
to wrap your app
-
In
src/index.js
, comment out Line 4 and activate Line 5 -
As long as the Auth module is configured with
oauth
, the Authentcator will render theSign In with AWS
button.
Using OAuth HOC
-
In
src/index.js
, comment out Line 5 and activate Line 4 -
In
src/App.js
, comment out Line 79 and activate Line 80 -
In
src/OAuthButton.js
, you can find a React Component wrapped by thewithOAuth
HOC, and theprops.OAuthSignIn
is passed into theonClick
props in thebutton
element in order to jump to the Hosted UI page.
Using Customized Button
-
In
src/index.js
, comment out Line 5 and activate Line 4 -
In
src/App.js
, comment out Line 80 and activate Line 79 -
In
src/CustomButton.js
, you can switch the url(The Hosted UI, Google Login Page, Facebook Login Page) and assign it to the window location.