@luigi-project/plugin-auth-oauth2 1.16.2 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +16 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -16,7 +16,7 @@ meta -->
16
16
 
17
17
  ## Overview
18
18
 
19
- This project contains a library that allows your application to extend the [Luigi framework](https://github.com/SAP/luigi/tree/master/core) with an OAuth2 authorization provider.
19
+ This [authorization plugin](https://github.com/SAP/luigi/tree/master/plugins/auth/public/auth-oauth2) contains a library that allows your application to extend the [Luigi framework](https://github.com/SAP/luigi/tree/master/core) with an OAuth2 authorization provider.
20
20
  Further configuration details can be found in the [main documentation](https://docs.luigi-project.io/docs/authorization-configuration#oauth2-implicit-grant-configuration).
21
21
 
22
22
  ## Installation
@@ -49,7 +49,11 @@ Luigi.setConfig({
49
49
  })
50
50
  ```
51
51
 
52
- The `callback.html` needs to be copied to a folder in your Luigi Core installation, which is the return path for the IdP provider, configured through the `redirect_uri` setting. The default location of `redirect_uri` is `/assets/auth-oauth2/callback.html`.
52
+ We provide a `callback.html` file through our `plugin-auth-oauth2` package. This `callback.html` file resides in `node_modules/@luigi-project/plugin-auth-oauth2/callback.html` and needs to be copied to a folder in your Luigi Core installation, which is the return path for the IdP provider, configured through the `redirect_uri` setting. The default location of `redirect_uri` is `/assets/auth-oauth2/callback.html`.
53
+
54
+ The examples given below give some alternatives on how to copy this file in your project. However, you may choose your own way of copying the `callback.html` file to the default location depending on your environment.
55
+
56
+ For applications involving a webpack configuration, one way to copy the `callback.html` file is using packages such as [copy-webpack-plugin](https://www.npmjs.com/package/copy-webpack-plugin) and then including the following in your webpack configuration file:
53
57
 
54
58
  ```javascript
55
59
  const CopyWebpackPlugin = require('copy-webpack-plugin');
@@ -63,3 +67,13 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
63
67
  ]
64
68
  }
65
69
  ```
70
+
71
+ If your application does not use webpack or you installed Luigi without a framework, you can use any copy plugin to copy the `callback.html` file and then modify the `package.json` script to copy the file when building. One package that could be helpful is [copyfiles](https://www.npmjs.com/package/copyfiles). Following is an example:
72
+
73
+ ```javascript
74
+ "buildConfig": "webpack --entry ./src/luigi-config/luigi-config.es6.js --output-path ./public/assets --output-filename luigi-config.js --mode production",
75
+ "build": "npm run buildConfig && npm run copyCallbackOAuth",
76
+ "copyCallbackOAuth": "copyfiles -f node_modules/@luigi-project/plugin-auth-oauth2/callback.html public/assets/auth-oauth2"
77
+ ```
78
+
79
+ Running `npm run build` should then suffice to bundle the config and also copy the callback file.
package/package.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "name": "@luigi-project/plugin-auth-oauth2",
3
- "version": "1.16.2",
4
3
  "description": "OAuth2 implicit grant provider plugin for @luigi-project/core",
5
4
  "license": "Apache-2.0",
6
5
  "main": "plugin.js",
@@ -16,5 +15,6 @@
16
15
  "core",
17
16
  "oauth2",
18
17
  "provider"
19
- ]
18
+ ],
19
+ "version": "1.19.0"
20
20
  }