项目作者: stanchino

项目描述 :
Serverless authentication components for React
高级语言: JavaScript
项目地址: git://github.com/stanchino/react-serverless-auth.git
创建时间: 2018-01-13T16:41:36Z
项目社区:https://github.com/stanchino/react-serverless-auth

开源协议:MIT License

下载


React Authentication Components using AWS Cognito

Build Status
Coverage Status
dependencies Status
npm version
Maintainability
Test Coverage

Try react-serverless-auth on CodeSandbox

Installation

  1. $ yarn add react-serverless-auth
  2. or
  3. $ npm install --save react-serverless-auth

Configuration

To simplify the integration with create-react-app the package uses
environment variables as described in the create-react-app
documentation.
The environment variables are handled using dotenv by default.

Amazon Cognito User Pool

To use the react-serverless-auth components you need to create an
Amazon Cognito User Pool
from the AWS Console for Cognito User Pools or using the
create-user-pool command in the
AWS CLI.

IMPORTANT: When creating the App,
the generate client secret box must be unchecked because the JavaScript SDK
doesn’t support
apps that have a client secret.

The User Pool ID and Client ID are specified in the following environment variables:

  1. REACT_APP_COGNITO_USER_POOL_ID
  2. REACT_APP_COGNITO_CLIENT_ID

Authentication URLs

The authentication endpoint URLs are configurable and the following default values are pre-defined in
src/routes.js:

  1. REACT_APP_AUTH_LOGIN_URL=/auth/login
  2. REACT_APP_AUTH_CONFIRM_URL=/auth/confirm
  3. REACT_APP_AUTH_REGISTER_URL=/auth/register
  4. REACT_APP_AUTH_RESET_URL=/auth/reset

Contributing

See CONTRIBUTING.md.

Technology Stack

Dependencies