Skip to main content
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

beta_app_service_create_application_request
object
required
Application configuration (OIDC, API, or SAML)
# 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
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
beta_app_service_list_applications_request
object
required
Request with filters
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
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
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

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
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

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

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
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
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
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:
  1. Replace BetaAppServiceApi with ApplicationServiceV2Api
  2. Update configuration models
  3. Review authentication method changes
  4. Test OAuth flows

See Also

Build docs developers (and LLMs) love