Authentication Methods
Crema supports JWT Auth, Auth0, Firebase, Aws auth methods
Crema supports 4 types of authentication methods as following. By default Crema comes with the firebase authentication method. You can switch between them by the following some steps written in the particular Auth method.
Don't forgot to change header in case you have different from "Authorization"
JWT Auth
JSON Web Token is a proposed Internet standard for creating data with an optional signature.
Crema demo is linked with the Mongoose server. You can find our predefined APIs here
To integrate JWT Auth you need to follow the following steps.
Open the
src/@
crema/services/auth/jwt-auth/index.js
file and update baseURL of your server like belowSet header token in the axios, go to the file
src/@
crema/services/auth/jwt-auth/index.js
and change the
Wrapp
<AuthRoutes
> with<JWTAuthProvider>
Component in thesrc/App.js
file like below.Uncomment the JWT Auth method like below in the
src/@crema/utility/AuthHooks.js
fileIn the final step, we need to call the
<SigninJwtAuth>
tag in thesrc/pages/auth/Signin/index.js
file like below and do the same for Signup.
Firebase
Firebase security applies Google's internal expertise to easily build app sign-ins. Develop simple, free multi-platform sign-in with Firebase Authentication. To integrate Firebase Auth you need to follow the following steps.
Configure your app here
Open the
src/@crema/services/auth/firebase/firebase.js
file and update firebaseConfig for your app like belowWrapp
<AuthRoutes
> with<FirebaseAuthProvider>
Component in thesrc/App.js
file like below.Uncomment the Firebase Auth method like below in the
src/@crema/utility/AuthHooks.js
fileIn the final step, we need to call the
<SigninFirebase>
tag in thesrc/pages/auth/Signin/index.js
file like below and do the same for Signup.
AWS
Amazon Cognito lets you add user sign-up, sign-in, and access control to your web and mobile apps quickly and easily. To integrate AWS Auth you need to follow the following steps.
Configure your app here
Open the
src/@crema/services/auth/aws-cognito/aws-exports.js
file and update awsConfig for your app like belowWrapp
<AuthRoutes
> with<AwsAuthProvider>
Component in thesrc/App.js
file like below.Uncomment the AWS Auth method like below in the
src/@crema/utility/AuthHooks.js
fileIn the final step, we need to call the
<SigninAwsCognito>
tag in thesrc/pages/auth/Signin/index.js
file like below and do the same for Signup.
Auth0
Rapidly integrate authentication and authorization for web, mobile, and legacy applications. To integrate. Auth0 you need to follow the following steps.
Configure your app here
Open the
src/@crema/services/auth/auth0/auth0Config.js
file and update Auth0Config for your app like belowWrapp
<AuthRoutes
> with<Auth0Provider>
Component in thesrc/App.js
file like below.Uncomment the Auth0 Auth method like below in the
src/@crema/utility/AuthHooks.js
fileIn the final step, we need to call loginWithRedirect method on the Login button.
Last updated