6. BayunS3
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_uXbttttpAb
region: "<region>", // e.g. us-east-7
clientId: "<clientId>", // e. g. 7s5cdrjuev1vd8531qace17nl2
},
};
const BayunConstants = {
BAYUN_APP_ID: "<BAYUN_APP_ID>", // provided on the admin panel
BAYUN_APP_SALT: "<BAYUN_APP_SALT>", // provided on the admin panel
BAYUN_APP_SECRET: "<BAYUN_APP_SECRET>", // provided on the admin panel
ENABLE_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.
Where to Go From Here?
You can find the BayunS3 app on Github.
For detailed step-by-step instructions on how to build and run the JavaScript application, see the README file.
Last updated