当前位置: 首页 > 软件库 > 云计算 > Serverless 系统 >

aws-serverless-auth-reference-app

授权协议 View license
开发语言 JavaScript
所属分类 云计算、 Serverless 系统
软件类型 开源软件
地区 不详
投 递 者 仉昱
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

SpaceFinder - Serverless Auth Reference App

SpaceFinder is a reference mobile app that allows users to book conference rooms, work desks, and other shared resources. The app showcases serverless authentication and authorization using the AWS platform.

The mobile front-end is built using the Ionic 3 framework and client libraries to call AWS services and mobile backend APIs. The backend APIs themselves are powered by AWS services. The backend APIs are built using a serverless architecture, which makes it easy to deploy updates, and it also means that there are no servers to operationally manage.

SpaceFinder is primarily developed and maintained by Jim Tran and Justin Pirtle, Solutions Architects at Amazon Web Services. The project code is released under the Apache 2.0 license. Please feel free to make use of the code in this project, and spread the word. We hope you enjoy it, and we certainly welcome all feedback, pull requests and other contributions!

Video presentation

A live demo of the SpaceFinder app was presented at AWS re:Invent 2017, the annual AWS cloud computing conference. The presentation provides useful context on the authentication and authorization flows that the app demonstrates. The YouTube recording of the session (53 minutes) is available here:

Quickstart and Developer Guide

  1. The Quickstart guide walks through setting up a demo environment (5 minutes) with a tutorial of key app flows (30 minutes). This lab is self-contained and cleans up after itself by un-deploying all auto-generated AWS resources.

  2. For developers who want to dig deeper, we've also prepared a Developer Guide. The Developer Guide provides instructions on setting up the project pre-requisites manually in your developer environment.

Architecture diagram

AWS services used

SpaceFinder is built using the following AWS services:

  • AWS Cognito - Amazon Cognito lets you easily add user sign-up and sign-in to your mobile and web apps. With Amazon Cognito, you also have the options to authenticate users through social identity providers such as Facebook, Twitter, or Amazon, with SAML identity solutions, or by using your own identity system. Furthermore, AWS Cognito supports User Groups that let to create collections of users to manage their permissions or to represent different types of users.
  • AWS Lambda - AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume - there is no charge when your code is not running. With Lambda, you can run code for virtually any type of application or backend service - all with zero administration.
  • Amazon DynamoDB - Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale. It is a fully managed cloud database and supports both document and key-value store models.
  • Amazon API Gateway - Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. You can create an API that acts as a “front door” for applications to access data, business logic, or functionality from your back-end services, such as workloads running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, or any Web application. Amazon API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management.
  • AWS CloudFormation - AWS CloudFormation gives developers and systems administrators an easy way to create and manage a collection of related AWS resources, provisioning and updating them in an orderly and predictable fashion.

Backend API

Spacefinder uses a Serverless API built using Amazon API Gateway, Lambda, DynamoDB, and CloudFormation. The API has the following REST methods, and some methods can only be called by users with "Admin" privileges.

Mobile app

The mobile app is a hybrid mobile app, and is built on the Ionic 3 framework, which relies on Angular 4 and TypeScript 2. The hybrid mobile app can run on Android devices and iOS devices, as well as a modern web browser.

User flows

The app currently demonstrates the following user flows:

  • Identity Management
    • Register as a new user
    • Confirm registration code
    • Sign in (as a user who has already confirmed a registration code)
    • Sign in (as a user who has not yet confirmed a registration code)
    • Re-send registration code
    • Forgot password
    • Change password
    • Sign-out
  • SpaceFinder Application Features
    • View list of locations
    • Add a new location (Admin-only feature)
    • Delete a location (Admin-only feature)
    • View list of resources at a location
    • Add a new resource (Admin-only feature)
    • Delete a resource (Admin-only feature)
    • View resource availability
    • Book a new booking
    • Cancel own booking
    • Cancel another user's booking (Admin-only feature)
    • Upload a profile image to Amazon S3
    • Toggle display of admin-only features

Using the app

Sample users and data

Sample users and location/resource data are created as part of the bootstrapping process, to make it easy for you to try out the user flows. Use the following users to login to the application. You may additionally create your own personal accounts.

  • Standard user

    • Username: user1
    • Password: Test123!
    • Can browse resources, make bookings, and upload profile picture
  • Admin user

    • Username: admin1
    • Password: Test123!
    • Can additionally create and delete locations and resources

Console logging

Enable the browser developer console (or remote debugging for Android) to view all of the log messages.

The log messages will show you all tokens retrieved as part of the sign-in process, as well as all API calls made and the corresponding authorization for each call.

  • by Paul Matthew Jaworski 保罗·马修·贾沃斯基(Paul Matthew Jaworski) 如何在AWS Lambda上构建无服务器NodeJS微服务 (How to build a serverless NodeJS microservice on AWS Lambda) 已淘汰 (DEPRECATED) Unfortunately, since I wrote thi

  • package 用于将serverless.yml转换为cloudformation的json文件,并将json文件,项目源码包等都放入指定目录(默认为.serverless),为项目部署做准备 基本命令 serverless package 命令参数 --stage 缩写为-s 用于指定部署的stage --region 缩写为-r 用于指定部署的region --package  缩写为-p

  • I am trying to access a bucket and all its object using AWS SDK but while running the code i am getting an error as Exception in thread "main" com.amazonaws.services.s3.model.AmazonS3Exception: Access

  • serverless.yml文件的作用 service: 声明一个serverless的service frameworkVersion:用于指定部署时需要的serverless版本,可以使用sls -v命令查看本地安装的serverless的版本 plugins:定义service用到的plugin provider: 定义云服务提供者,比如aws functions:在service中定义一个

  • 1) 改变时区 root 用户在AWS EC2 系统时区改变, Linux上可以用 /usr/bin/tzselect 进行,然后 vi /root/.profile,加入以下一行 TZ='Asia/Shanghai'; export TZ servie cron restart 2)设置crontab 运行脚本 crontab -e 增加一行 00 22 * * * python /root/s

  • 什么是 AWS Config? AWS Config 提供了关于您的 AWS 账户中 AWS 资源配置的详细信息。这些信息包括资源之间的关联方式以及资源以前的配置方式,让您了解资源的配置和关系如何随着的时间的推移而更改。 AWS 资源 是您可以在 AWS 中使用的一种实体,例如 Amazon Elastic Compute Cloud (EC2) 实例、Amazon Elastic Block S

 相关资料
  • aws-serverless-koa This library enables you to utilize AWS Lambda and Amazon API Gateway to respond to web and API requests using the Koa.js application framework Installation $ npm install --save aws

  • Wild Rydes Serverless Workshops This repository contains a collection of workshops and other hands on content that will guide you through building various serverless applications using AWS Lambda, Ama

  • A crash course on Serverless Authentication/Authorization A short and easy boilerplate showcasing JWT auth with Nodejs, the Serverless framework, MongoDB and AWS Lambda. The auth folder has a VerifyTo

  • AWS Serverless Airline Booking Serverless Airline Booking is a complete web application that provides Flight Search, Payment, Booking and Loyalty points including end-to-end testing, GraphQL and CI/CD

  • Serverless Java container The aws-serverless-java-container makes it easy to run Java applications written with frameworks such as Spring, Spring Boot, Apache Struts, Jersey, or Spark in AWS Lambda. S

  • AWS Serverless Ecommerce Platform Status: Work-in-progress. Please create issues or pull requests if you have ideas for improvement. The Serverless Ecommerce Platform is a sample implementation of a s