Overview
TheIdentityProviderServiceApi provides methods for managing identity providers in Zitadel. Identity providers enable users to authenticate using external services like Google, Azure AD, GitHub, and other OIDC/SAML providers.
Initialize the API
Identity Provider Management
get_idpby_id
get_idpby_id
Returns an identity provider (social/enterprise login) by its ID. The provider can be of type Google, Azure AD, GitHub, etc.
The ID of the identity provider to retrieve
Identity Provider Types
OIDC Providers
Supports generic OIDC providers and specific implementations:- Azure AD
- GitHub
- GitLab
- Generic OIDC
SAML Providers
Supports SAML 2.0 identity providers:- Azure AD SAML
- Generic SAML
OAuth Providers
Supports OAuth 2.0 providers:- GitHub
- GitLab
- Azure AD
Example: Get Identity Provider Details
Example: Check Available Identity Providers
Integration with User Service
Identity providers are typically used in conjunction with the User Service for managing user links:Identity Provider Configuration
OIDC Configuration
Typical OIDC identity provider configuration includes:- Issuer: The OIDC provider’s issuer URL
- Client ID: OAuth client identifier
- Client Secret: OAuth client secret
- Scopes: Requested scopes (e.g.,
openid,profile,email) - Display Name Mapping: How to map the display name claim
- Email Mapping: How to map the email claim
SAML Configuration
Typical SAML identity provider configuration includes:- Metadata URL: URL to the SAML metadata XML
- Entity ID: SAML entity identifier
- Binding: POST or Redirect binding
- WithSignedRequest: Whether to sign SAML requests
- Attribute Mapping: Mapping for email, display name, etc.
Identity Provider States
- ACTIVE: The identity provider is active and can be used for authentication
- INACTIVE: The identity provider is configured but not available for authentication
Example: Retrieve Multiple IDPs
Best Practices
- Cache IDP Information: Identity provider configurations don’t change frequently, so consider caching the results
- Error Handling: Always handle cases where an IDP might not exist or is inactive
- Security: Never expose IDP secrets in logs or client-side code
- User Experience: Show appropriate branding and labels based on IDP type
- Testing: Test the authentication flow for each configured IDP
Common Use Cases
Display Available Login Options
Verify IDP Configuration
See Also
- User Service - Manage user IDP links
- Settings Service - Configure active IDPs
- OIDC Service - OIDC authentication flows