Перейти к содержимому

С чего начать

SDK и библиотеки

Официальные клиенты для Sign in with Identvia и AgentPass. Каждый пакет — открытый исходный код на GitHub в организации Identvia.

Скопируйте промпт для своего ИИ-агента

Пользуетесь агентом для написания кода? Этот промпт направит его к этой документации и перечислит правила, которым он обязан следовать. Проверяйте написанный им код, как любой другой.

You are helping me add "Sign in with Identvia" to my app (PHP). Identvia is an OpenID Connect provider.

Read these first (they are plain Markdown and are the source of truth; prefer them over anything you remember):
- https://id.identvia.com/developers/docs/quickstart.md
- https://id.identvia.com/developers/docs/oidc.md
- https://id.identvia.com/developers/docs/security.md
- Discovery: https://id.identvia.com/.well-known/openid-configuration

Stack: plain PHP 8.1+ (no framework). Use the official SDK identvia/identvia-php (composer require identvia/identvia-php, or the zip with vendor/ from https://id.identvia.com/developers/docs/php for hosts without Composer). Create identvia.php (config), login.php (redirectToSignIn), callback.php (handleCallback, then session_regenerate_id(true) and store sub) and logout.php. Read secrets from environment variables or a config file outside the web root.

Requirements:
1. Authorization code flow with PKCE (S256 only), a random state and a nonce per sign-in. No implicit flow.
2. Validate the ID token: RS256 signature from the JWKS, iss = https://id.identvia.com, aud contains my client_id, exp/iat, and the nonce.
3. Identify users by sub (it is pairwise: different for every app). Treat email as optional, because the person may choose not to share it.
4. Redirect URIs must match exactly. Keep the client secret and refresh tokens server-side; never log tokens.
5. Ask only for the scopes I need (openid, plus email/profile if used). Handle the user canceling (error=access_denied) gracefully.

Optional, only if I ask for AI-agent access later:
- AgentPass (agents acting for a user with single-use, holder-bound passes): https://id.identvia.com/developers/docs/agentpass.md
- MCP server for agent clients: https://id.identvia.com/developers/docs/mcp.md
- Token exchange, rich authorization requests and CIBA: https://id.identvia.com/developers/docs/delegation.md

Before writing code, tell me which files you will add or change. Don't invent endpoints or options that aren't in the docs; if something is unclear, ask me.

identvia-js

JavaScript / TypeScript

OIDC-клиент для браузера и Node, плюс опциональные React-хелперы.

Установка
npm install @identvia/js
Смотреть на GitHub

identvia-react-native

React Native / Expo

Нативный вход для приложений Expo и React Native.

Установка
npx expo install @identvia/react-native expo-web-browser expo-secure-store expo-crypto
Смотреть на GitHub

identvia-flutter

Flutter

Пакет Flutter для Sign in with Identvia на iOS и Android.

Установка
flutter pub add identvia
Смотреть на GitHub

identvia-swift

Swift / iOS

Клиент Swift Package Manager для iOS и macOS.

Установка
.package(url: "https://github.com/Identvia/identvia-swift", from: "0.1.0")
Смотреть на GitHub

identvia-android

Android / Kotlin

Kotlin-клиент с Custom Tabs и App Links.

Установка
implementation("com.identvia:identvia-android:0.1.0")
Смотреть на GitHub

identvia-dotnet

.NET

Обработчик аутентификации ASP.NET Core для Identvia.

Установка
dotnet add package Identvia.AspNetCore
Смотреть на GitHub

identvia-wordpress

WordPress

Sign in with Identvia в WordPress (конфиденциальный клиент PKCE).

Установка
Copy to wp-content/plugins/identvia-login and activate
Смотреть на GitHub

identvia-php

PHP

Чистый PHP 8.1+ OIDC SDK; zip доступен с этого сервера.

Установка
composer require identvia/identvia-php
Смотреть на GitHub

agentpass-php

PHP (AgentPass)

Сервисный SDK для федеративного Authority AgentPass v0.1.

Установка
composer require identvia/agentpass-php
Смотреть на GitHub

Нужна пошаговая инструкция? Начните с Quickstart или руководства по PHP SDK. Подсказки по платформам также появляются при создании приложения в консоли разработчика.