1.0.8 • Published 2 months ago

@zerosubnet/directus-extension-external-jwt v1.0.8

Weekly downloads
-
License
LGPL-3.0-only
Repository
github
Last release
2 months ago

External JWT Plugin for Directus

This plugin serves as a way to make Directus trust externally signed JWT tokens from an OIDC or OAuth2 provider.

The plugin expects to resolve the following new configuration option

The provider must issues Access tokens as JWT since this is used for verification right now. Might add support for general tokens later.

If USEDB are enabled the extension will try to search for the user in the database by looking at the sub in the JWT token. The user must exists and all roles for that use will be used.

When using USEDB you should also enable the caching option to reduce the time spent against the api and reduce the number of db lookups. The cache stores the user object in the cache based on the sub in the token.

USEDB also validates that the issuer is the same as assigned to the user.

Configuration

all configuration options listed here are an extension to directus default config.

ENV VariableSupported valuesDescription
AUTH_PROVIDER_TRUSTEDTrue/FalseMust be true for the provider to be considered as trusted. Note, do not trust public providers as these can generate tokens that you cannot control.
AUTH_PROVIDER_JWT_ROLE_KEYStringWhat key in the JWT payload contains the role
AUTH_PROVIDER_JWT_ADMIN_KEYStringWhat key in the JWT payload contains a bool to grant admin rights
AUTH_PROVIDER_JWT_APP_KEYStringWhat key in the JWT payload contains a bool to allow app access
AUTH_PROVIDER_JWT_USEDBBoolIf enabled/true the plugin will resolve the user and roles from the directus database using the token. For OIDC the sub is used. Should not be used without a Redis Cache enabled.
CACHE_JWT_NAMESPACEStringWhat namespace to use in cache store.
CACHE_JWT_TTLNumberTime to live for the cached user entry, default 5000 (5 seconds)
1.0.9-beta.2

2 months ago

1.0.9-beta.1

2 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.7-beta.1

6 months ago

1.0.6-beta.2

6 months ago

1.0.6

7 months ago

1.0.6-beta.1

7 months ago

1.0.5-beta.7

7 months ago

1.0.5-beta.6

7 months ago

1.0.5-beta.5

7 months ago

1.0.5-beta.4

9 months ago

1.0.5-beta.3

9 months ago

1.0.5-beta.2

9 months ago

1.0.5-beta.1

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3-beta.7

9 months ago

1.0.3

9 months ago

1.0.3-beta.6

9 months ago

1.0.3-beta.5

9 months ago

1.0.3-beta.4

9 months ago

1.0.3-beta.3

9 months ago

1.0.3-beta.2

9 months ago

1.0.3-beta.1

9 months ago

1.0.2

9 months ago

1.0.0-beta.1

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago