
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@startupjs/auth-azuread
Advanced tools
yarn add @startupjs/auth-azuread
yarn add react-native-webview
В webpack.server.config.cjs -> forceCompileModules добавить:
@startupjs/auth-azuread/server
В webpack.web.config.cjs -> forceCompileModules добавить:
@startupjs/auth-azuread
1 - Перейти на Microsoft Azure portal
2 - Создать аккаунт, если его нет
3 - Перейти в Active Directory
4 - Перейти на вкладку Регистрация приложений
5 - Далее Новая регистрация, нужно заполнить поля
6 - Скопировать Идентификатор приложения как AZUREAD_CLIENT_ID
, в config.json
7 - Скопировать Идентификатор каталога как AZUREAD_TENTANT_ID
, в config.json
8 - Перейти во вкладку Конечные точки, скопировать Документ метаданных OpenID Connect как AZUREAD_IDENTITY_METADATA
в config.json. Вместо common/organizations должен стоять Идентификатор каталога.
9 - Во вкладке Сертификаты и секреты, создать секрет клиента, скопировать как AZUREAD_CLIENT_SECRET
в config.json.
10 - Далее нужно настроить URI перенаправления, для этого нужно перейти во вкладку с настройкой URI перенаправления. Создать платформы с ссылками:
SPA платформа - http://localhost:3000/auth/azuread/callback
Web платформа - http://localhost:3000/auth/azuread/callback-native
11 - В манифесте указать данные:
"oauth2AllowIdTokenImplicitFlow": true,
"oauth2AllowImplicitFlow": true
Импорт стратегии:
import { Strategy as AzureadStrategy } from '@startupjs/auth-azuread/server'
Импорт либы для конфига:
import conf from 'nconf'
В startupjsServer, в стратегии функции initAuth нужно добавить AzureadStrategy, с переменными из конфига:
initAuth(ee, {
strategies: [
new AzureADStrategy({
clientId: conf.get('AZUREAD_CLIENT_ID'),
clientSecret: conf.get('AZUREAD_CLIENT_SECRET'),
tentantId: conf.get('AZUREAD_TENTANT_ID'),
identityMetadata: conf.get('AZUREAD_IDENTITY_METADATA'),
allowHttpForRedirectUrl: process.env.NODE_ENV !== 'production'
})
]
})
Параметр allowHttpForRedirectUrl
- определяет возможность использования http
для redirect url
Для продакшена нужно использвать https в BASE_URL, и условие process.env.NODE_ENV !== 'production'
import { AuthButton as AzureadAuthButton } from '@startupjs/auth-azuread/client'
FAQs
AzueAd auth plugin for StartupJS auth module
The npm package @startupjs/auth-azuread receives a total of 0 weekly downloads. As such, @startupjs/auth-azuread popularity was classified as not popular.
We found that @startupjs/auth-azuread demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.