1.41.0 • Published 2 months ago

@wmfs/tymly-auth-auth0-plugin v1.41.0

Weekly downloads
55
License
MIT
Repository
github
Last release
2 months ago

tymly-auth-auth0-plugin

Tymly Package npm (scoped) CircleCIcodecov CodeFactor Dependabot badge Commitizen friendly JavaScript Style Guide license

Provides auth0 utility functionality to the TymlyJS platform

Install

$ npm install tymly-auth-auth0-plugin --save

Once installed, you will need to go to the auth0 management interface and create a new client (type: non-interactive). On the settings screen, make a note of the DOMAIN, CLIENT ID and the CLIENT SECRET (these three values will need to be setup in three environment variables, respectively TYMLY_NIC_AUTH0_DOMAIN, TYMLY_NIC_AUTH0_CLIENT_ID and TYMLY_NIC_AUTH0_CLIENT_SECRET).

Scroll down to the bottom of the page and click the Show Advanced Settings link. Click the Grant Types tab and ensure that IMPLCIT, AUTHORIZATION CODE, REFRESH TOKEN and CLIENT CREDENTIALS grants are all ticked.

Finally, on the left-hand side of the screen, click on the APIs link. Click on the Auth0 Management API link. Click on the Non Interactive Clients tab. After a few moments, a list of clients will be displayed - find the non-interactive client you just created and switch the toggle next to it to the Authorized position. Finally, in the clients scopes, find the scope "read:users", tick it and click the update button.

Proxy Configuration

It should be obvious, but please note that this plugin makes calls to various web APIs. If you are behind a firewall which, you may optionally set the PROXY_URL environment variable. This url will should look something like 'http://[USERNAME]:[PASSWORD]@[PROXY HOST]:PROXY PORT'.

Note that if your on a Active Directory network, your username may need to be prefixed with a domain, followed by the three characters '%5C', to separate the domain from the username.

So for example, if your domain is called 'WORLD', your username is 'j.smith', your password is 'superhero', your proxy host is 'proxy.world.net' and your proxy port is 1234, your proxy url would look like "http://world%5Cj.smith:superhero@proxy.world.net:1234".

Tuning

The service makes use of a cache so that expensive HTTP requests are kept to a minimum.

  • By default, the size of this cache is 500, but this can be overridden via the (optional) TYMLY_USER_CACHE_SIZE environment variable.
  • By default, entries in the cache have a lifetime of 30 minutes, but this can be overridden via the (again optional) TYMLY_USER_CACHE_MAX_AGE_IN_MS environment variable.
  • By default, when invoking external web API calls, a timeout is set to 3 seconds, but this can be overridden via the (optional, yet again) WEB_API_TIMEOUT_IN_MS environment variable.

Testing

Before running the tests (and indeed, using the utility functions the service provides), you'll need to set the following environment variables.

TYMLY_NIC_AUTH0_DOMAIN=abc.de.auth0.com
TYMLY_NIC_AUTH0_CLIENT_ID=abc...
TYMLY_NIC_AUTH0_CLIENT_SECRET=abc...

Once the environment variables have been set, you can run the tests like this:

$ npm test

License

MIT

1.41.0

2 months ago

1.40.0

7 months ago

1.39.0

11 months ago

1.38.0

11 months ago

1.37.0

1 year ago

1.36.0

1 year ago

1.33.1

1 year ago

1.35.0

1 year ago

1.32.0

1 year ago

1.34.0

1 year ago

1.33.0

1 year ago

1.31.0

2 years ago

1.29.0

2 years ago

1.30.0

2 years ago

1.28.1

2 years ago

1.28.0

3 years ago

1.27.2

3 years ago

1.27.0

3 years ago

1.27.1

3 years ago

1.26.1

3 years ago

1.26.2

3 years ago

1.26.0

3 years ago

1.25.0

3 years ago

1.24.0

3 years ago

1.23.1

3 years ago

1.23.0

3 years ago

1.22.0

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.19.3

4 years ago

1.19.2

4 years ago

1.19.1

4 years ago

1.19.0

4 years ago

1.18.0

4 years ago

1.17.1

4 years ago

1.17.0

4 years ago

1.16.3

4 years ago

1.16.2

4 years ago

1.16.1

5 years ago

1.16.0

5 years ago

1.15.0

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.1

5 years ago

1.11.0

5 years ago

1.10.1

5 years ago

1.10.0

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.1

5 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago