Giter Site home page Giter Site logo

adrianbrs / nest-oidc-provider Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 15.0 500 KB

oidc-provider module for Nest framework (node.js)

License: MIT License

JavaScript 1.54% TypeScript 88.19% CSS 0.08% EJS 10.18%
nest nestjs oauth2 openid openid-connect openid-provider provider server

nest-oidc-provider's Introduction

Hi there!

Welcome to Adrian's Github!
Pergunte-me qualquer coisa aqui
ou entre em contato por email.

🚀 Alguns dos meus projetos mais interessantes:

  • 🎵 Pubby.club Site para criar salas de vídeo de diversas plataformas.
  • 🎮 Open Hotel Um remake do Habbo Hotel em JS.
  • 🔒 nest-oidc-provider oidc-provider module for Nest framework
  • ph1-assembly | ph1-emulator Montador/emulador de uma arquitetura de computador didática (PH1) desenvolvida em Go, para a disciplina de Arquitetura e Organização de Computadores I.
  • 🛠️ jcc Estudo de caso de um compilador C minimalista construído em JavaScript
  • 🖥️ connect PoC de uma plataforma de webconferência, desenvolvida em Vue, utilizando WebRTC e SocketIO.
  • 🎨 easy-color-parser Meu primeiro projeto open-source 😃

Adrian's github stats

Adrian's Top languages

nest-oidc-provider's People

Contributors

adrianbrs avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nest-oidc-provider's Issues

Error when interaction aborted

Issue: When the user aborts the interaction it breaks the application and it's not possible to use it until cookies are cleared.

{"error":"access_denied","error_description":"End-user aborted interaction"}

Error:

TypeError: Cannot read properties of undefined (reading 'getOIDCScopeEncountered')

Node v18 not allowed

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When installing the package I get the error "The engine "node" is incompatible with this module. Expected version "^12.19.0 || ^14.15.0 || ^16.13.0". Got "18.12.1""

Minimum reproduction code

No response

Steps to reproduce

  1. npm ci
  2. Get error

Expected behavior

Node v18 should work fine as oidc-provider supports it: https://github.com/panva/node-oidc-provider/blob/efd5344216017860fb01f015e3ae3a29273f1f89/package.json#L106

NestJS version

9.2.0

Packages versions

Node.js version

18.12.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Trusting TLS offloading proxies

Issue: Currently, it's not possible to set the proxy for the provider.

Error: oidc-provider WARNING: x-forwarded-proto header not detected for an https issuer, you must configure your ssl offloading proxy and the provider, see documentation for more details: https://github.com/panva/node-oidc-provider/tree/v7.12.0/docs/README.md#trusting-tls-offloading-proxies

Solution Proposal:

private static createOidcProvider(): Provider {
    return {
      provide: oidc.Provider,
      useFactory: async (moduleOptions: OidcModuleOptions): Promise<any> => {
        // Change controller path manually until Nest doesn't provide an official way for this
        // (see https://github.com/nestjs/nest/issues/1438)
        Controller({
          path: validatePath(moduleOptions.path),
          version: moduleOptions.version,
        })(OidcController);

        const provider = new oidc.Provider(
          moduleOptions.issuer,
          moduleOptions.oidc,
        );
        
        -> provider.proxy = true <-
        
        return provider;
      },
      inject: [OIDC_MODULE_OPTIONS],
    };
  }

I think that it could be solved by adding provider.proxy = true as in the above example or would be better if we can set from nest-oidc-module settings.

Require error with openid-provider 8

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Installing with node-oids-provider 8 returns the following error: Error [ERR_REQUIRE_ESM]: require() of ES Module sso/node_modules/oidc-provider/lib/index.js from sso/node_modules/nest-oidc-provider/dist/oidc.service.js not supported. Instead change the require of index.js in sso/node_modules/nest-oidc-provider/dist/oidc.service.js to a dynamic import() which is available in all CommonJS modules.

Minimum reproduction code

No response

Steps to reproduce

No response

Expected behavior

Application is able to start without errors

oidc-provider version

8.1.1

nest-oidc-provider version

1.1.1

NestJS version

9.4.0

Packages versions

Node.js version

18.15.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

client_id is mandatory property

I am facing this weird issue that doesn't explains much other than the following message when accessing via web /oidc/auth?client_id=xxx or through postman grant_type=client_credentials

error: invalid_client_metadata
error_description: client_id is mandatory property

How to fix middleware parser is not recommended warning message

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

I'm getting this warning

oidc-provider WARNING: already parsed request body detected, having upstream middleware parser is not recommended, resolving to use req.body or request.body instead

when doing a client_credentials token request (/oidc/token)

Minimum reproduction code

No response

Steps to reproduce

No response

Expected behavior

How can I avoid this warning ?
It should be handled by the module or a configuration path ?

Package

  • oidc-provider
  • nest-oidc-provider
  • I don't know. Or some 3rd-party package
  • Other (see below)

Other package

No response

NestJS version

9.0.11

Packages versions

platform-express version : 9.0.11
schematics version       : 9.0.1
passport version         : 9.0.0
terminus version         : 9.1.1
graphql version          : 10.1.1
swagger version          : 6.1.2
typeorm version          : 9.0.1
testing version          : 9.0.5
apollo version           : 10.1.0
common version           : 9.0.11
config version           : 2.2.0
axios version            : 0.1.0
core version             : 9.0.11
jwt version              : 9.0.0
cli version              : 9.0.0

Node.js version

16.15.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

(ASK) Nest ^9

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

it possible to use this library with latest nest?

Describe the solution you'd like

upgrade to nest ^9

Teachability, documentation, adoption, migration strategy

What is the motivation / use case for changing the behavior?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.