pbplus-cognito-sdk
AWS Cognito login flow sdk for PBPlus.
Last updated 3 years ago by bill42362 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pbplus-cognito-sdk 
SYNC missed versions from official npm registry.

pbplus-cognito-sdk

AWS Cognito login flow sdk for PBPlus.

Behaviors

  • Fetch refresh token from AWS::Cognito by code from cognito login page.
  • Save fetched refresh token in cookie by cookieDomain.
  • Fetch access token by refresh token from cookie.
  • Auto-update access token (by exporesIn comes with access token).

You can

  • Read access token from getState().pbplusCognitoSdk.accessToken.
  • Read login endpoint from getState().pbplusCognitoSdk.loginEndpoint.
  • No access token in store means user not logged in.

These values in redux store will be read.

const store = createStore(
    reducer,
    {   
        pbplusCognitoSdk: {
            oauthUrl: process.env.OAUTH_URL,
            oauthSecret: process.env.OAUTH_SECRET,
            clientId: process.env.OAUTH_CLIENT_ID,
            cookieDomain: process.env.COOKIE_DOMAIN,
        }   
    }
);
  • oauthSecret comes from Base64Encode(client_id:client_secret).

Current Tags

  • 1.3.0                                ...           latest (2 years ago)

8 Versions

  • 1.3.0                                ...           2 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |