참고
OpenID Connect
PHP가 아니신가요? Identvia는 표준 OpenID Connect 제공자입니다. 인증된 라이브러리를 아래 issuer에 연결하세요.
AI 에이전트용 프롬프트 복사
코딩 에이전트를 사용하나요? 이 프롬프트는 에이전트가 이 문서를 참고하도록 하고 반드시 지켜야 할 규칙을 알려 줍니다. 에이전트가 작성한 코드도 다른 코드처럼 검토하세요.
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.
You are helping me add "Sign in with Identvia" to my app (Laravel). 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: Laravel. Use the official SDK identvia/identvia-php (framework-agnostic) from a small service class bound in a service provider, not a hand-written OAuth client. Add GET /auth/identvia/redirect and GET /auth/identvia/callback routes in the web middleware group. After the callback, find-or-create the user by the Identvia sub (not by email), call Auth::login() and $request->session()->regenerate(). Put the client secret in .env and config/services.php.
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.
You are helping me add "Sign in with Identvia" to my app (Symfony). 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: Symfony. Use the official SDK identvia/identvia-php wrapped in a service, plus a custom authenticator (AbstractAuthenticator) on the callback route. Map users by the Identvia sub, not email. Keep the client secret in Symfony secrets or env vars, never in committed config.
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.
You are helping me add "Sign in with Identvia" to my app (Node.js). 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: Node.js. There is no Identvia JavaScript SDK; use a certified OpenID Connect relying-party library (for example openid-client) with discovery from the issuer. Use the authorization code flow with PKCE (S256), state and nonce, keep tokens server-side in the session store, and regenerate the session id after sign-in.
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.
You are helping me add "Sign in with Identvia" to my app (Python). 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: Python. There is no Identvia Python SDK; use a maintained OpenID Connect client library (for example Authlib) with discovery from the issuer. Use the authorization code flow with PKCE (S256), state and nonce, and keep tokens server-side.
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.
디스커버리
| issuer | https://id.identvia.com |
|---|---|
| 디스커버리 | https://id.identvia.com/.well-known/openid-configuration |
| 권한 부여 | https://id.identvia.com/oauth/authorize |
| 토큰 | https://id.identvia.com/oauth/token |
| Userinfo | https://id.identvia.com/oauth/userinfo |
| JWKS | https://id.identvia.com/oauth/jwks.json |
| 취소 | https://id.identvia.com/oauth/revoke |
| 세션 종료 | https://id.identvia.com/oauth/logout |
Identvia가 강제하는 규칙
- 인가 코드 흐름만(response_type=code). 암시적/하이브리드 없음.
- 공개 클라이언트는 S256 PKCE가 필수입니다(단일 페이지 앱, 모바일 앱, 네이티브 앱). 모든 클라이언트에 권장합니다. client secret으로 인증하는 서버 측 앱은 생략할 수 있으며, OpenID Connect가 허용하는 대로 nonce도 생략할 수 있습니다.
- 리다이렉트 URI는 문자 단위로 정확히 일치. 와일드카드·프래그먼트 없음. http://localhost는 Development 환경만.
- 인가 코드는 일회용이며 60초 후 만료. 재사용하면 발급된 토큰이 취소됩니다.
- ID 토큰은 RS256 서명. 액세스 토큰은 10분. 리프레시(스코프 offline_access)는 사용마다 회전; 옛것을 재사용하면 체인 전체가 취소됩니다.
- 콜백에 iss(RFC 9207)가 포함됩니다. 확인하세요.
- sub는 pairwise: 같은 사람이라도 앱마다 다른 안정 ID.
1. 권한 부여 요청
HTTP
GET https://id.identvia.com/oauth/authorize
?response_type=code
&client_id=oid_…
&redirect_uri=https%3A%2F%2Fexample.com%2Fcallback
&scope=openid%20email%20profile
&state=<random, 32+ bytes>
&nonce=<random, 32+ bytes>
&code_challenge=<BASE64URL(SHA256(code_verifier))>
&code_challenge_method=S256선택: prompt=none|login|consent, max_age, login_hint.
2. 토큰 요청
HTTP
POST https://id.identvia.com/oauth/token
Authorization: Basic base64(client_id:client_secret)
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&code=…&redirect_uri=https%3A%2F%2Fexample.com%2Fcallback&code_verifier=…공개 클라이언트는 비밀 대신 본문에 client_id를 보냅니다.
Response
{
"token_type": "Bearer",
"access_token": "eyJ…",
"expires_in": 600,
"id_token": "eyJ…",
"refresh_token": "…", // offline_access가 있을 때만
"scope": "openid email profile"
}3. ID 토큰 검증
- 일치하는 kid의 JWKS 키로 서명을 검증하세요. RS256만 수락.
- iss는 https://id.identvia.com와 같고; aud에 client ID가 포함되며; azp가 있으면 client ID입니다.
- exp는 미래이고 iat는 아님(1분 오차 허용).
- nonce는 보낸 것과 같습니다.
- max_age를 보냈다면 auth_time을 확인하세요.
클레임
| 스코프 | 클레임 |
|---|---|
| openid | sub, auth_time, amr |
| email, email_verified (사용자가 공유할 때만) | |
| profile | name, given_name, family_name, picture, updated_at (사용자가 공유하는 것만) |
| offline_access | 리프레시 토큰 |
동의 화면에서 공유 항목을 고르므로 요청한 스코프라도 클레임이 빠질 수 있습니다. 처리하세요.
네이티브 및 데스크탑 앱
개발자 포털에서 환경을 네이티브 & 데스크탑 앱으로 등록하세요. 리디렉션 URI는 다음을 사용할 수 있습니다:
- 개인 사용 URI 스킴의 역 도메인 형식 (RFC 8252 §7.1), 예: com.example.app:/oauth/identvia. myapp:와 같은 짧은 스킴은 거부됩니다.
- 클레임된 HTTPS 앱 링크 (iOS 유니버설 링크 / 안드로이드 앱 링크).
- 루프백 http://127.0.0.1:{port}/… 또는 http://[::1]:{port}/…. 모든 포트가 일치하며, 경로는 정확히 일치해야 합니다 (RFC 8252 §7.3).
iOS 17.4 이전: ASWebAuthenticationSession은 https:// 콜백을 신뢰할 수 있게 반환하지 않습니다. 해당 버전에서는 개인 사용 스킴을 선호하고, iOS 17.4 이상에서는 유니버설 링크를 사용하세요.