Chuyển đến nội dung

Bắt đầu

SDK & thư viện

Máy khách chính thức cho Sign in with Identvia và AgentPass. Mọi gói đều mã nguồn mở trên GitHub thuộc tổ chức Identvia.

Sao chép prompt cho tác nhân AI của bạn

Đang dùng tác nhân lập trình? Prompt này hướng nó tới tài liệu này và liệt kê các quy tắc nó phải tuân theo. Hãy xem lại những gì nó viết như mọi đoạn code khác.

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

Máy khách OIDC cho trình duyệt và Node, kèm helper React tùy chọn.

Cài đặt
npm install @identvia/js
Xem trên GitHub

identvia-react-native

React Native / Expo

Đăng nhập gốc cho ứng dụng Expo và React Native.

Cài đặt
npx expo install @identvia/react-native expo-web-browser expo-secure-store expo-crypto
Xem trên GitHub

identvia-flutter

Flutter

Gói Flutter cho Sign in with Identvia trên iOS và Android.

Cài đặt
flutter pub add identvia
Xem trên GitHub

identvia-swift

Swift / iOS

Máy khách Swift Package Manager cho iOS và macOS.

Cài đặt
.package(url: "https://github.com/Identvia/identvia-swift", from: "0.1.0")
Xem trên GitHub

identvia-android

Android / Kotlin

Máy khách Kotlin với Custom Tabs và App Links.

Cài đặt
implementation("com.identvia:identvia-android:0.1.0")
Xem trên GitHub

identvia-dotnet

.NET

Trình xử lý xác thực ASP.NET Core cho Identvia.

Cài đặt
dotnet add package Identvia.AspNetCore
Xem trên GitHub

identvia-wordpress

WordPress

Sign in with Identvia trên WordPress (máy khách bảo mật PKCE).

Cài đặt
Copy to wp-content/plugins/identvia-login and activate
Xem trên GitHub

identvia-php

PHP

SDK OIDC PHP 8.1+ thuần; có thể tải zip từ máy chủ này.

Cài đặt
composer require identvia/identvia-php
Xem trên GitHub

agentpass-php

PHP (AgentPass)

SDK dịch vụ cho authority liên kết AgentPass v0.1.

Cài đặt
composer require identvia/agentpass-php
Xem trên GitHub

Cần hướng dẫn? Bắt đầu với Quickstart hoặc tài liệu PHP SDK. Mẹo theo nền tảng cũng hiện khi bạn tạo ứng dụng trong bảng điều khiển nhà phát triển.