---
title: Deploy Casdoor with AI on Blossom
url: "/deploy/casdoor/"
canonical_url: https://blossom88.com/deploy/casdoor/
markdown_url: https://blossom88.com/deploy/casdoor.md
summary: Sign in to a sample app with Casdoor and give one user access to its orders.
categories:
- deployment
- security
stack:
- Go
- React
- SQLite
---

# Deploy Casdoor with AI on Blossom

[Casdoor](https://casdoor.ai/) lets your apps share sign-in and user
management. This recipe gives one user access to sample orders and
checks that a second signed-in user still needs the reader role.

## Ask Your Agent

> **Ask your AI agent:** Deploy Casdoor on Blossom and help me give a test user read-only access to a sample app.
>
> Follow this guide: https://blossom88.com/deploy/casdoor/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## Have Ready

- **Stable HTTPS address** (Required): Keep the issuer address stable for connected clients.
- **App callback URL** (Required): Register the exact redirect URL used by the client.

## How It Runs

| Part | Role | Where |
|---|---|---|
| Casdoor | Handle sign-in, issue tokens, and store users and roles | Single Persistent Service with SQLite |

## Deploy a Private Casdoor Instance

Run the official image on a
[Persistent Service Volume](/docs/apps/persistent-services/).
Keep the workshop behind Blossom Account access.

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom service:create --data casdoor.yml
    blossom env_var:push --environment environment-100 --file .env.production
    blossom environment:deploy --id environment-100 --follow

</details>

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Set `driverName=sqlite` and point `dataSourceName` at a database on
`/casdoor-data`. Keep `origin` and `originFrontend` on the stable
HTTPS address. Store the initial administrator password privately.
Use `/.well-known/openid-configuration` for the HTTP health check.

</details>

## Connect the Workshop Client

Create an application and register its exact callback URL. Use the
[OpenID Connect settings](https://casdoor.ai/docs/how-to-connect/oidc-client/)
for the code flow and signing keys.

> **Ask your AI agent:** Connect my sample orders app to Casdoor and register its callback.

> Follow this guide: https://blossom88.com/deploy/casdoor/



![Sign in to the sample Workshop Orders client with Casdoor.](/deploy/assets/images/casdoor/workshop-orders-login.webp)

## Test Both Users

Give just one of two users the Orders reader role. Sign in as each
and verify the signed tokens. Use the role claim to allow or deny
the sample app's order view.

> **Ask your AI agent:** Help me verify that only the Orders reader can view the sample orders.

> Follow this guide: https://blossom88.com/deploy/casdoor/



## Check Access After an Update

Replace the Casdoor Container on the same Volume. Open a fresh
browser session and confirm that both users still sign in with
the same access.

> **Ask your AI agent:** Replace Casdoor and verify that both users kept the same access.

> Follow this guide: https://blossom88.com/deploy/casdoor/



<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom service:scale --id service-casdoor-100 --desired-size 0 --follow
    blossom service:scale --id service-casdoor-100 --desired-size 1 --follow

</details>

![Read the sample orders with the same role after replacing Casdoor.](/deploy/assets/images/casdoor/orders-reader-after-replacement.webp)

## What You Get

- A private Casdoor workshop
- An OpenID Connect client with its own callback
- A role that lets one user view sample orders
- The same sign-in and access after a Container update

Tested on Blossom: Both users signed in again after replacement and only the Orders reader could view the sample orders.
