Deprecated: Use Application Service v2 instead. This service will be removed in the next major version of ZITADEL.
Overview
The BetaAppServiceApi provides methods for managing applications within projects, including OIDC, API, and SAML applications.
Initialization
require 'zitadel/client'
client = Zitadel::Client::ApiClient.new
client.config.access_token = 'your_access_token'
app_service = Zitadel::Client::Api::BetaAppServiceApi.new(client)
Key Methods
Application Management
create_application - Create new application
beta_app_service_create_application_request
Application configuration (OIDC, API, or SAML)
OIDC application configuration
API application configuration
# Create OIDC application
request = Zitadel::Client::Models::BetaAppServiceCreateApplicationRequest.new(
project_id: '123456789',
name: 'My Web App',
oidc_config: {
redirect_uris: ['https://myapp.com/callback'],
response_types: ['CODE'],
grant_types: ['AUTHORIZATION_CODE'],
app_type: 'WEB',
auth_method_type: 'BASIC'
}
)
response = app_service.create_application(request)
puts "App ID: #{response.app_id}"
puts "Client ID: #{response.client_id}"
puts "Client Secret: #{response.client_secret}"
Required Permission: project.app.write
get_application - Get application details
request = Zitadel::Client::Models::BetaAppServiceGetApplicationRequest.new(
project_id: '123456789',
app_id: '987654321'
)
response = app_service.get_application(request)
puts "Application: #{response.app.name}"
Required Permission: project.app.read
list_applications - List project applications
beta_app_service_list_applications_request
request = Zitadel::Client::Models::BetaAppServiceListApplicationsRequest.new(
project_id: '123456789'
)
response = app_service.list_applications(request)
response.result.each do |app|
puts "App: #{app.name} (#{app.app_type})"
end
Required Permission: project.app.read
update_application - Update application config
Changes application name and configuration.request = Zitadel::Client::Models::BetaAppServiceUpdateApplicationRequest.new(
project_id: '123456789',
app_id: '987654321',
name: 'Updated App Name'
)
app_service.update_application(request)
Required Permission: project.app.write
delete_application - Delete application
Deletes the application from the project.request = Zitadel::Client::Models::BetaAppServiceDeleteApplicationRequest.new(
project_id: '123456789',
app_id: '987654321'
)
app_service.delete_application(request)
Required Permission: project.app.delete
Application Lifecycle
deactivate_application - Deactivate application
Sets application state to inactive.request = Zitadel::Client::Models::BetaAppServiceDeactivateApplicationRequest.new(
project_id: '123456789',
app_id: '987654321'
)
app_service.deactivate_application(request)
Required Permission: project.app.write
reactivate_application - Reactivate application
Sets application state back to active.request = Zitadel::Client::Models::BetaAppServiceReactivateApplicationRequest.new(
project_id: '123456789',
app_id: '987654321'
)
app_service.reactivate_application(request)
Required Permission: project.app.write
Secret Management
regenerate_client_secret - Regenerate client secret
Generates new client secret for OIDC or API applications.request = Zitadel::Client::Models::BetaAppServiceRegenerateClientSecretRequest.new(
project_id: '123456789',
app_id: '987654321'
)
response = app_service.regenerate_client_secret(request)
puts "New secret: #{response.client_secret}"
Store the secret securely - it cannot be retrieved again!
Required Permission: project.app.write
Application Keys
create_application_key - Create API key
Creates authentication key for API applications.request = Zitadel::Client::Models::BetaAppServiceCreateApplicationKeyRequest.new(
project_id: '123456789',
app_id: '987654321',
type: 'JSON',
expiration_date: (Time.now + 365 * 24 * 60 * 60).iso8601
)
response = app_service.create_application_key(request)
puts "Key ID: #{response.key_id}"
puts "Key Details: #{response.key_details}" # Store safely!
Required Permission: project.app.write
list_application_keys - List application keys
Returns all keys for the application.request = Zitadel::Client::Models::BetaAppServiceListApplicationKeysRequest.new(
project_id: '123456789',
app_id: '987654321'
)
response = app_service.list_application_keys(request)
response.result.each do |key|
puts "Key: #{key.key_id} (expires: #{key.expiration_date})"
end
Required Permission: project.app.read
get_application_key - Get key details
Retrieves specific key information.request = Zitadel::Client::Models::BetaAppServiceGetApplicationKeyRequest.new(
key_id: '111222333'
)
response = app_service.get_application_key(request)
puts "Key type: #{response.key.type}"
Required Permission: project.app.read
delete_application_key - Delete API key
Deletes an application key.request = Zitadel::Client::Models::BetaAppServiceDeleteApplicationKeyRequest.new(
project_id: '123456789',
app_id: '987654321',
key_id: '111222333'
)
app_service.delete_application_key(request)
Required Permission: project.app.write
Application Types
OIDC Applications
For web applications, SPAs, and mobile apps:
oidc_config: {
redirect_uris: ['https://myapp.com/callback'],
response_types: ['CODE'],
grant_types: ['AUTHORIZATION_CODE', 'REFRESH_TOKEN'],
app_type: 'WEB', # or 'USER_AGENT', 'NATIVE'
auth_method_type: 'BASIC', # or 'POST', 'NONE'
post_logout_redirect_uris: ['https://myapp.com/logout'],
dev_mode: false
}
API Applications
For service-to-service communication:
api_config: {
auth_method_type: 'PRIVATE_KEY_JWT'
}
SAML Applications
For SAML 2.0 based applications:
saml_config: {
metadata_url: 'https://sp.example.com/saml/metadata'
}
Required Permissions
project.app.read - Read application information
project.app.write - Modify applications
project.app.delete - Delete applications
Migration Guide
To migrate to Application Service v2:
- Replace
BetaAppServiceApi with ApplicationServiceV2Api
- Update configuration models
- Review authentication method changes
- Test OAuth flows
See Also