@cimpress/simple-auth-wrapper
Advanced tools
Comparing version 6.3.2 to 6.4.0
# Changelog | ||
## 6.4 (2018-10-2) | ||
Added support for the Authorization Code Grant Flow. See the [README](/README.md) for details. | ||
## 6.3 (2018-08-28) | ||
@@ -4,0 +7,0 @@ |
@@ -34,3 +34,12 @@ 'use strict'; | ||
var _authorizationcodegrant = require('./authorizationcodegrant'); | ||
Object.defineProperty(exports, 'AuthorizationCodeGrant', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_authorizationcodegrant).default; | ||
} | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@cimpress/simple-auth-wrapper", | ||
"version": "6.3.2", | ||
"version": "6.4.0", | ||
"description": "A simple utility class to wrap basic Auth0 functionality", | ||
"main": "lib/index.js", | ||
"main": "src/index.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "test": "jest", |
@@ -106,1 +106,29 @@ # MEX Simple Auth Wrapper v. 3.0 | ||
`patchUserMetadata(userMetadata, applicationKey)` applicationKey should match what is used for get. Puts the metadata into the users UserMetadata | ||
### Authorization Code Grant Flow | ||
The [Authorization Code Grant Flow](https://auth0.com/docs/api-auth/tutorials/authorization-code-grant) can be used to retrieve a refresh token for a user. | ||
```javascript | ||
import { AuthorizationCodeGrant } from '@cimpress/simple-auth-wrapper'; | ||
const authorizationCodeGrant = new AuthorizationCodeGrant(options); | ||
``` | ||
| Name | Type | Default | Description | | ||
|-----------------|--------|----------------------------|---------------------------------------------------------------------------------| | ||
| `clientID` | String | None (required) | The clientID used in the Authorization Code Grant Flow | | ||
| `redirectRoute` | String | "" | The route Auth0 will redirect back to: `window.location.origin + redirectRoute` | | ||
| `domain` | String | `cimpress.auth0.com` | The auth0 domain | | ||
| `audience` | String | `https://api.cimpress.io/` | The auth0 audience | | ||
| `scope` | String | `offline_access` | The scope which you want to request access for | | ||
This will give you access to: | ||
`login(options)` Starts the Authorization Code Grant Flow, redirecting the user to the centralized lock page. | ||
| Name | Type | Default | Description | | ||
|-----------|--------|---------|-------------------------------------------------------------------------------| | ||
| `nextUri` | String | `/` | Takes the user through the flow and will be returned to this `nextUri` route. | | ||
`handleAuthorization()` Resumes the authorization code grant flow. Should be called at the base of your application, or at the `redirectUri` specified to continue the flow. Returns a Promise of `{ authorizationCode, redirectUri, nextUri }` |
export { default as centralizedAuth } from './centralizedauth'; | ||
export { default as UserMetadata } from './usermetadata'; | ||
export { default as Delegation } from './delegation'; | ||
export { default as AuthorizationCodeGrant } from './authorizationcodegrant'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
292977
29
1543
133