mise-react-redux-auth0
v1.1.7
Published
Auth module that will be used across the internal apps - MISE
Downloads
3
Readme
mise-react-redux-auth0
NPM module for Auth0 services
Auth module will be used across various applications, providing the same API for Auth0 authentication services.
Usage
import AuthConstructor from "mise-react-redux-auth0";
const Auth0 = new AuthConstructor(config);
/* ... */
API
- AuthConstructor {object}: Default export of an Auth constructor. Takes a
config
object. More info in the next section - authReducer {function}: Named export of a predefined auth redux reducer
- callbackReducer {function}: Named export of a predefined callback redux reducer
- getAuthActions {function}: Named export of a function that takes an Auth instance, and returns redux action creators
- Callback {Component}: Named export of a React Component used to handle authentication routing
- SecuredRoute {Component}: Named export of a React Component that secures regular, non-authenticated routes
AuthConstructor Config API
- domain {REQUIRED, string}: Your Auth0 account domain
- clientID {REQUIRED, string}: The Client ID found on your Application settings page
- redirectUri {OPTIONAL, string}: The URL where Auth0 will call back to with the result of a successful or failed authentication. It must be whitelisted in the "Allowed Callback URLs" in your Auth0 Application settings
- scope {OPTIONAL, string}: The default scope used for all authorization requests
- audience {OPTIONAL, string}: The default audience, used if requesting access to an API
- responseType {OPTIONAL, string}: Response type for all authentication requests. It can be any space separated list of the values
code
,token
,id_token
. If you don't provide globalresponseType
, you will have to provide aresponseType
for each method that you use - responseMode {OPTIONAL, string}: The default responseMode used, defauts to
'fragment'
. TheparseHash
method can be used to parse authentication responses using fragment response mode. Supported values arequery
,fragment
, andform_post
. Thequery
value is only supported whenresponseType
iscode
. - __disableDeprecationWarnings {OPTIONAL, boolean}: Indicates if deprecation warnings should be output to the browser console, defaults to
false
Instance API
- In progress...
Download & Installation
Make sure you have .npmrc setup so you can pull packages from Azure DevOps registry.
npm i mise-react-redux-auth0
or
yarn add mise-react-redux-auth0