Crema supports 4 types of authentication methods as follows. By default, Crema comes with the firebase authentication method. You can switch between them by following some steps written in the particular Auth method.
Don't forget to change the header in case you have a different form "Authorization"
JWT Auth
JSON Web Token is a proposed Internet standard for creating data with an optional signature.
The 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 libs/services/auth/src/jwt-auth/index.js file and update baseURL of your server like below
Set header token in the axios, go to the file libs/services/auth/src/jwt-auth/index.js and change the
exportconstsetAuthToken= (token) => { if (token) {jwtAxios.defaults.headers.common['Authorization'] ='Bearer '+ token;// Change this according your requirementlocalStorage.setItem('token', token); } else {deletejwtAxios.defaults.headers.common['Authorization'];localStorage.removeItem('token'); }};
Update the AppAuthProvider component in the file apps/source/src/core/AppAuthProvider/index.js like below.
In the final step, we need to call the<SigninJwtAuth> tag in the apps/source/src/modules/auth/Signin/index.js file like below and do the same for Signup.
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.
In the final step, we need to call the<SigninFirebase> tag in the apps/source/src/modules/auth/Signin/index.js file like below and do the same for Signup.
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.
In the final step, we need to call the<SigninAwsCognito> tag in the apps/source/src/modules/auth/Signin/index.js file like below and do the same for Signup.
Rapidly integrate authentication and authorization for web, mobile, and legacy applications. To integrate. Auth0 you need to follow the following steps.