version: 1
metadata:
  name: Odoo OAuth2 Setup
entries:
  - model: authentik_providers_oauth2.oauth2provider
    identifiers:
      slug: odoo
    state: present
    attrs:
      name: Odoo
      authorization_flow: !KeyOf default-oauth-authorization
      redirect_uris: |
        https://odoo.ai-impress.com/auth_oauth/signin/odoo
        https://odoo.ai-impress.com/auth_oauth/signin/authentik
      sub_mode: user_uuid
      include_claims_in_id_token: true
      signing_key: !Find [authentik_crypto.certificatekeypair, {name: 'authentik Self-signed Certificate'}]
      client_type: confidential
  - model: authentik_core.application
    identifiers:
      slug: odoo
    state: present
    attrs:
      name: Odoo
      provider: !Find [authentik_providers_oauth2.oauth2provider, {slug: odoo}]
