npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nfjs/auth-openid

v1.0.1

Published

Authorization by openid module

Downloads

52

Readme

ОГЛАВЛЕНИЕ

Используемые понятия

Клиент - инстанс класса обёртки над openid-client.

Принцип работы

Является оберткой над пакетом openid-client. Позволяет сконфигурировать экземпляр для аутентификации пользователя (встроиться в общий механизм @nf/auth) и получить роли для приложения. Осуществляется это с помощью следующих шагов:

  • на основной форме desktop.frm выполняется запрос на подмененный роут веб сервера /front/action/check-auth, для проверки авторизованности в приложении
  • при получении информации от веб сервера, что не пользователь не авторизован и вместе с этим приходит адрес, на который нужно перенаправиться для аутентификации
  • ожидается ответный вызов на адресе /openid/callback с состоянием не равным logout
  • достается информация о пользователе из токенов, отдельно выиискиваются его роли(_roles), уникальное(_username) и полное(_fullname) имя, и складывается в сессию пользователя(openid-userinfo) на веб сервере вместе с токенами
  • выполняются хуки, помеченные как "до авторизации"
  • выполняются хуки, помеченные как "авторизация" (обычно это сохранение информации о пользователе в постоянное хранилище). Если они успешно прошли, считается что пользователь полностью авторизован в приложении
  • выполняются хуки, помеченные как "после авторизации"
  • происходит перенаправление на адрес / и форма desktop.frm уже показывает оснвную форму (main.frm) приложения.

В последующих запросах к веб серверу, на роуте в котором указана auth middleware юудет проверятся время жизни access токена и пытается обновиться по истечении.

Конфигурация

Описание в package.config.json В блоке client можно указывать все опции для оригинального класса Client пакета openid-client.