BayunS3 is a sample application that uses overridden methods from S3Wrapper SDK for secure storage onto AWS S3. The app itself works exactly similar to the case of an app using the original AWS S3 SDK directly. However, the wrapper SDK automatically encrypts a file before uploading it to the S3 bucket and decrypts it after downloading it, without the application having to deal with encryption keys, etc.
AWS Credentials
To use Amazon Cognito user pools, you need an AWS account. You can create a user pool through the Amazon Cognito console. You can follow the AWS developer guide to create user pool.
Replace the values of UserPoold, Region and ClientId their respective values in the config.js file.
You are provided with an App Id and Application Secret when your app is registered with Bayun, see Registering a new App. In the config.js file, replace value of BayunAppId, BayunAppSalt, BayunAppSecret, EnableFaceRecognition, and BaseUrl.
window._config={cognito:{userPoolId:"<userPoolId>",// e.g. us-east-4_uXbttttpAbregion:"<region>",// e.g. us-east-7clientId:"<clientId>",// e. g. 7s5cdrjuev1vd8531qace17nl2},};constBayunConstants={BAYUN_APP_ID:"<BAYUN_APP_ID>",// provided on the admin panelBAYUN_APP_SALT:"<BAYUN_APP_SALT>",// provided on the admin panelBAYUN_APP_SECRET:"<BAYUN_APP_SECRET>",// provided on the admin panelENABLE_FACE_RECOGNITION:false|true,BASE_URL:"<BASE_URL>",// provided on the admin panel};
Register and Login
You need to first signUp using Amazon Cognito User Pools . Enter your username, password, email and set your company name. Hit Register button, You will be redirected to verification page and you will receive a confirmation code on your email address. Enter the email address and confirmation code in the verification screen and complete your signup process.
After signup you can signIn to your account. Provide your username and password to signIn. You should be able to upload/download files to/from the bucket.
In the BayunS3 sample app, you have to explicitly mention your bucket name, for this the bucket has to be created(with NO-CORS policy) on AWS console in advance. You can provide your own bucket name for upload/download operations.