JSPM

@luigi-project/plugin-auth-oauth2

1.16.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3347
  • Score
    100M100P100Q117729F
  • License Apache-2.0

OAuth2 implicit grant provider plugin for @luigi-project/core

Package Exports

  • @luigi-project/plugin-auth-oauth2

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@luigi-project/plugin-auth-oauth2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

OAuth2 - Authorization Plugin for Luigi Core

Overview

This project contains a library that allows your application to extend the Luigi framework with an OAuth2 authorization provider. Further configuration details can be found in the main documentation.

Installation

Install the plugin in your project using npm:

npm install @luigi-project/plugin-auth-oauth2

Import the plugin in places where you want to use it, depending on the environment of your choice:

var oAuth2ImplicitGrant = require('@luigi-project/plugin-auth-oauth2');

or

import oAuth2ImplicitGrant from '@luigi-project/plugin-auth-oauth2';

Then, integrate it as an authorization provider in your Luigi configuration file:

Luigi.setConfig({
  auth: {
    use: 'myProviderConfig',
    myProviderConfig: {
      idpProvider: oAuth2ImplicitGrant,
      // ... configuration data comes here
      redirect_uri: '/assets/auth-oauth2/callback.html'
    }
  }
})

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.

const CopyWebpackPlugin = require('copy-webpack-plugin');

{
  plugins: [
    new CopyWebpackPlugin([{
      from: 'node_modules/@luigi-project/plugin-auth-oauth2/callback.html',
      to: 'src/assets/auth-oauth2'
    }])
  ]
}