# Poppy playground: what its discovery checks prove, run from public files

> Poppy playground checks, a real agent sign-in that filled a cart on the Drift Bean demo store, and my own demo store that passed after one fix.

- URL: https://iamops.dev/poppy-playground-lab/
- Language: en
- Author: Argo
- Published: 2026-11-26
- Category: Labs
- Depth: Practitioner
- Audience: Engineers and operators
- Time: 18 min
- Topics: Poppy protocol, Auth0, OAuth, AI agents, Labs

## TL;DR

- The [playground's Discovery page](https://iamops.dev/poppy-playground-lab/#does-the-discovery-claim-hold) showed 19 of 19 checks passed against the Drift Bean demo store. I reproduced 13 of them from public files with curl and jq, and all 13 matched.
- On Drift Bean the [agent signed in](https://iamops.dev/poppy-playground-lab/#step-by-step) with five permissions, including placing orders, got a key-bound token, and added one $28 coffee to the cart without ordering.
- All eight steps were walked through: [Session passed 10 checks](https://iamops.dev/poppy-playground-lab/#step-3-session) with one not run, the browser joined signed in, and two steps are not offered.
- On a [local demo store](https://iamops.dev/poppy-playground-lab/#sign-in-on-a-local-demo-store) the agent got only the two scopes I approved, was refused when it tried to order, and lost access after revocation.
- The playground failed a [public copy of that store](https://iamops.dev/poppy-playground-lab/#the-same-store-on-a-public-https-address) for not listing PS384, then passed it 20 of 20 after the fix.

**Audience: Practitioners.** This lab is for developers and identity engineers who want to see what the playground's discovery checks read. Skip the first section if you only want the result.

The playground's Discovery page ran 19 checks against the Drift Bean demo store, and all 19 passed. I reproduced the 13 checks that read public files with `curl` and `jq`, and all 13 matched. The other three kinds of check depend on live requests or on the playground's own schema check, and I did not reproduce them.

The [news article](https://iamops.dev/poppy-personal-agent-protocol-auth0-beta/) reported the same 19 of 19 result as background. This lab confirms the public-file part of it. It does not confirm the three checks I did not reproduce.

The second half tries the sign-in pattern on [a small store that runs on your own computer](#sign-in-on-a-local-demo-store), which needs no account on anyone else's site.

## Setup and run

The first half uses `curl` commands, with `jq` to pick out the fields the playground checks. You need both and internet access. Those commands make only GET requests to the public demo store, its sign-in server and the playground. No account, no login, no form, no personal data.

```bash
export STORE=https://driftbeandemo.com
export PLAYGROUND=https://poppyplayground.dev
```

## Read the store file

The store's discovery file is what the playground checks. It lists the protocol version, the organization domain, the sign-in server and the scopes:

```bash
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' "$STORE/.well-known/poppy.json"
curl -s "$STORE/.well-known/poppy.json" | jq '{protocol_version, domain: .organization.domain,
  issuer: .auth.issuer, scopes: (.auth.scopes | keys), apis: (.apis | length), web: (.web != null)}'
```

![Terminal output: curl reads driftbeandemo.com poppy.json, status 200, protocol 1.0, the domain and the sign-in issuer, and four scopes](https://iamops.dev/media/poppy-playground-lab/01-store.webp)

*The store file. Protocol 1.0, the domain, the sign-in server and four scopes.*

The store also points at one sign-in server, and that server's metadata has to name the same issuer. The next reads check that link.

## Does the discovery claim hold

Three public files hold everything the reproducible checks need: the store file above, the store's protected resource metadata and the sign-in server's metadata. Read the other two:

```bash
curl -s "$STORE/.well-known/oauth-protected-resource" | jq '{resource, authorization_servers}'
ISSUER=$(curl -s "$STORE/.well-known/poppy.json" | jq -r .auth.issuer)
curl -s "${ISSUER%/}/.well-known/oauth-authorization-server" | jq --arg iss "$ISSUER" --arg store "$STORE" '{
  issuer_matches: (.issuer == $iss), authorization_endpoint, device_authorization_endpoint, revocation_endpoint,
  authorization_code: (.grant_types_supported | index("authorization_code") != null),
  refresh_token: (.grant_types_supported | index("refresh_token") != null),
  browser_sign_in: (.scopes_supported | index("poppy:browser-sign-in") != null),
  protects_store: (.protected_resources | index($store) != null)}'
```

Together with the store file, these answer the 13 checks: the file is served over <abbr title="Hypertext Transfer Protocol Secure">HTTPS</abbr> (200), protocol `1.0`, the domain is the host that served it, it lists <abbr title="application programming interface">API</abbr>s and a website, the protected resource is the store, there is one `https` issuer, the metadata names exactly that issuer, `refresh_token` and `authorization_code` are listed, the revocation, authorization and device endpoints are present, `poppy:browser-sign-in` is a supported scope, and the store is among the protected resources.

![Terminal output: curl and jq read the protected resource metadata and the sign-in server metadata; the issuer matches, the endpoints are present, the browser sign-in scope is supported and the store is a protected resource](https://iamops.dev/media/poppy-playground-lab/02-discovery.webp)

*The two metadata files. Every public-file check holds. Three kinds of check were not reproduced.*

The playground's own page shows the result. When I opened its Discovery page on 26 November 2026, I pressed no button, signed in to nothing and typed nothing, and the page showed 19 passed against the sample store.

![Poppy playground Discovery step: Nothing failed in what ran, 19 passed against Drift Bean Demo, and the first checks with status 200](https://iamops.dev/media/poppy-playground-lab/ui-1-discovery.webp)

*The playground's own result. 19 of 19 passed. The side menu shows which steps have not run.*

The page's 19 names and my 13 checks are not one-to-one. Mine come from the public files. Three kinds I did not reproduce: the playground's schema check, the tasks endpoint check, and the live request checks.

## The playground's own address

The playground does not publish a discovery file. The page checks the store, not itself:

```bash
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' "$PLAYGROUND/discovery"
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' "$PLAYGROUND/.well-known/poppy.json"
```

![Terminal output: curl, the Discovery page returns 200 and the playground's own poppy.json returns 404](https://iamops.dev/media/poppy-playground-lab/03-playground.webp)

*The playground's addresses. The page loads, and the playground has no discovery file of its own.*

The flow the lab observed is short. The commands read the store's file, then read the sign-in server's metadata, and the two point back at each other:

![Sequence diagram: the lab reads the store's poppy.json, the store returns its issuer and scopes, the script asks the sign-in server for its metadata, which points back at the store's issuer, and the playground returns 404 for its own discovery file](https://iamops.dev/img/poppy-playground-lab-flow.svg)

*What the run showed. Two public reads, one link checked, and one file missing from the playground.*

## Step by step

Follow these in order at `https://poppyplayground.dev`. Keep the sample store `driftbeandemo.com` selected in the box at the top of the side menu. For the signed-in steps, create an account on the Drift Bean demo store first, with a password you use nowhere else, and enter only made-up data. My pictures are from 27 November 2026. I did the sign-in and the first shopping run before the Session checks, so the side menu in some pictures is further along or behind.

### Step 1: Discovery

Open **Discovery** and select **Run checks**. It reads public files only and needs no account. All 19 checks passed.

![Poppy playground Discovery step: nothing failed in what ran, 19 passed against Drift Bean Demo](https://iamops.dev/media/poppy-playground-lab/s1-discovery.webp)

*Discovery. The first checks, each answered with 200.*

![The rest of the Discovery checks, ending with the device authorization endpoint and the browser sign-in scope](https://iamops.dev/media/poppy-playground-lab/s1-discovery-end.webp)

*The rest of the list. Sign-in server, revocation, device code and browser sign-in.*

### Step 2: Watch an agent shop

Open **Watch an agent shop**. A simulated phone asks an agent to shop at the store. Choose the direct sign-in and sign in with your test account on the store's own page. The store then lists what the playground asks for. It offered Decline and Accept, and I saw no way to leave a single permission out.

![Drift Bean approval screen: Poppy Playground asks to change the cart, see orders, place orders with the saved address and payment method, use the website and keep offline access, with a warning to check the external domain](https://iamops.dev/media/poppy-playground-lab/dr-1-consent.webp)

*The store's approval screen. Placing orders is part of the request. The account name is hidden.*

After I accepted, the phone showed five granted permissions: <code>cart:write</code>, <code>orders:read</code>, <code>orders:write</code>, <code>poppy:browser-sign-in</code> and <code>offline_access</code>. The agent's browser was on the store, signed in, with a time limit counting down.

![Poppy playground with the list of five permissions granted to the agent, next to the agent's browser signed in on the Drift Bean store, identifiers hidden](https://iamops.dev/media/poppy-playground-lab/dr-2-permissions.webp)

*Five permissions granted. The client identifier and the account name are hidden.*

Type this into the phone: <em>Find a light roast under $30 and add it to my cart. Do not place an order.</em> The agent searched, opened one product to confirm the roast, and added Konga Natural, Yirgacheffe, at $28.00 for 250 g. The cart showed one item, and the agent reported that it had not ordered.

![The agent reports that it added a light roast at 28 dollars to the cart and placed no order, while the store page shows one item in the cart](https://iamops.dev/media/poppy-playground-lab/dr-3-cart.webp)

*The task done. One item in the cart, no order.*

The phone keeps a safety check list. In the first run it showed seven entries, and the ones I opened were marked Allowed.

![Safety check list in the playground: entries marked Allowed for ordinary shop content, for the click on Add to cart and for opening the product page](https://iamops.dev/media/poppy-playground-lab/dr-4-safety.webp)

*The safety check. Each visible entry is a page or a click that was allowed.*

I ran the request a second time without the words about ordering. The agent again added the coffee and placed no order. Two runs are not proof of a limit: the agent held <code>orders:write</code> both times. On my own store, below, the permission was left out and the store refused the order.

The Requests tab of this step does not list the agent's web requests, because the agent runs on the playground's server. It lists the decisions of the playground's guard about what the agent tried. In the second run there were 13: nine allowed and four marked unsure. A decision model named Clef was unsure whether opening the start page and the product page served my request. For both, a second entry from the playground's own policy reads <em>Went ahead without asking</em>. The clicks on the product link and on Add to cart were allowed because they matched the request.

![Guard decisions in the playground: allowed entries for page content and clicks, and unsure entries from the policy and the Clef model for opening the product page](https://iamops.dev/media/poppy-playground-lab/dr-8-guard.webp)

*The guard's decisions. Unsure did not mean stopped: the policy let the page open.*

The entries link to section 10.1 of the specification. That section says content from a company is data, not instructions, and that such text is never the user's approval. The guard, its model and its policy are choices of this playground, not something that section defines. The same run showed a cost of $0.0044 for the agent and the guard together.

### Step 3: Session

Open **Session**. Type `https://api.driftbeandemo.com/cart` into the address field, leave the box under it unticked, and select **Run checks**. The field is marked optional, but with it left blank I got no result at all in my browser.

![Poppy playground Session step with the cart address of the Drift Bean API typed into the field, before running the checks](https://iamops.dev/media/poppy-playground-lab/s3-session-input.webp)

*The address to enter. A read-only cart address.*

The playground sent a temporary user and session. Ten checks passed and one did not run. Most of them send a deliberately wrong request, so 400 is the right answer: a broken signature, another company as audience, a different method or address, a day-old token, a missing version header and version 2.0.

![Session checks: 10 passed and 1 not run, with 200 for the fresh sessions and 400 for each broken request](https://iamops.dev/media/poppy-playground-lab/s3-session-results.webp)

*Session checks. The store accepted good requests and refused altered ones.*

The check that did not run is the expired delegation. The page explains that its trusted signer issues only current delegations, and that editing the expiry would test the signature instead.

![The check Reject an expired delegation, marked not run with the explanation that only current delegations are issued](https://iamops.dev/media/poppy-playground-lab/s3-session-notrun.webp)

*Not run, with the reason. So expiry of a delegation stays untested.*

### Step 4: Sign-in

Open **Sign-in**. The page offers a direct sign-in on the store's own page or a device code, and lets you pick the requested scopes. I requested all 18, chose Direct and selected <strong>Open the Company's sign-in</strong>.

![Sign-in step with Direct and Device choices, Mediated not offered, and the list of requested scopes](https://iamops.dev/media/poppy-playground-lab/s4-signin-choices.webp)

*The choices. Direct, Device and the requested scopes.*

The token response granted five. The playground notes that the user approved fewer scopes than requested and lists the 13 missing ones, all about identity and contact data, such as <code>openid</code>, <code>email</code>, <code>phone</code> and <code>address</code>.

Open **Requests** at the top and select the exchange of the authorization code. The playground masks the secret values. The agent sent a <abbr title="Proof Key for Code Exchange">PKCE</abbr> verifier, a signed client assertion with the address of its own metadata file as client identifier, and a <abbr title="Demonstrating Proof of Possession">DPoP</abbr> proof.

![Token request in the playground log: DPoP header, authorization code grant, redirect address, code verifier, client identifier and client assertion, secret values masked](https://iamops.dev/media/poppy-playground-lab/dr-7-token-request.webp)

*The token request. Code, verifier, proof and assertion are masked.*

The answer was 200 with a token of type <code>DPoP</code> that expires in 86,400 seconds, one day, plus a refresh token. A DPoP token is bound to the agent's key, so a copied token alone should not work. I did not try to replay it. My demo store has no such binding.

![Token response in the playground log: status 200, masked access and refresh tokens, five scopes, expiry 86400 and token type DPoP, request identifiers hidden](https://iamops.dev/media/poppy-playground-lab/dr-6-token-response.webp)

*The token response. Bound with DPoP and valid for one day. Request identifiers are hidden.*

Lower on the page, select <strong>Refresh access token</strong>. The agent got a new access token with the same five scopes and 24 hours left, without asking me again.

![Token card after a refresh: five granted scopes, a new DPoP access token with 24 hours left, token values and key hidden](https://iamops.dev/media/poppy-playground-lab/s4-token-card.webp)

*After the refresh. Token values and the key are hidden.*

### Step 5: Browser

Open **Browser** and select **Join signed in**. The store's join page gives the agent's browser a one-time code, the agent approves it from its own side, and the browser submits it. The access token never passes through the browser. All seven requests passed.

![Browser step: the agent's browser joined this session signed in, 7 requests passed, with the four stages of the join](https://iamops.dev/media/poppy-playground-lab/s5-browser-joined.webp)

*The join. Open the page, authorize the code, submit, use the website.*

![List of what happened: page 200 with a join cookie, authorize 204 with the access token, submit 303 and a redirect to the login address](https://iamops.dev/media/poppy-playground-lab/s5-browser-what.webp)

*What happened. 200, 204, then redirects into the store's own login.*

The page also noted that, against step 3 of section 6 in the specification, the browser still held two other cookies from the first page.

### Step 6: APIs

Open **APIs** and select **Load operations**. The store lists eight.

![APIs step with the store's operations for products, cart, orders and the agent policy](https://iamops.dev/media/poppy-playground-lab/s6-api-list.webp)

*The operations. Reads, cart changes, checkout and the agent policy.*

Select <code>GET /orders</code>, then **Build request** and **Send**. Do not send <code>POST /orders</code>: it checks out the cart. The answer was 200, signed in, with an empty list, so neither shopping run had placed an order.

![Signed-in GET orders request answered with 200 and an empty list of orders](https://iamops.dev/media/poppy-playground-lab/s6-api-orders.webp)

*No orders. The account's order list is empty.*

Send <code>GET /agent-policy</code> the same way. The store says guests can browse and fill a cart, and that an order needs the customer to sign the agent in and approve <code>orders:write</code>. A signed-in agent without a needed scope gets 403. The policy sets 120 requests a minute and a maximum order of 200000 cents, asks for an idempotency key on orders, and keeps the list of connected agents, disconnecting them and the activity log for the customer.

![Agent policy response listing what guests and signed-in agents may call](https://iamops.dev/media/poppy-playground-lab/s6-api-policy.webp)

*The store's rules for agents. Published by the store itself.*

### Step 7: Company Agent

The store's discovery file lists no conversation protocol, so there is nothing to talk to.

![Company Agent step: Drift Bean Demo does not offer a Company Agent, and nothing is wrong](https://iamops.dev/media/poppy-playground-lab/s7-company.webp)

*Not offered. No store assistant.*

### Step 8: Task coverage

The store lists no tasks endpoint, so there are no excluded tasks and no feedback call to test.

![Task coverage step: Drift Bean Demo lists no tasks endpoint, and nothing is wrong](https://iamops.dev/media/poppy-playground-lab/s8-coverage.webp)

*Not offered. No tasks endpoint.*

### The report

Open **Your report**. It showed 29 passed, nothing to review in what ran, and two steps that the store does not offer. The page itself says a clean report is evidence of what ran, not a certificate of conformance.

![The playground report: nothing failed in what ran, 29 passed, two steps not offered](https://iamops.dev/media/poppy-playground-lab/s9-report.webp)

*The report. The end of the walk-through.*

The traffic described here is what the playground's own pages show. I have no access to the store's logs.

## Sign in on a local demo store

To see what a sign-in gives an agent, I built two small programs: a store called Cedar Cup, with its own sign-in server, and a demo personal agent. Both run on one computer. The sign-in follows the shape of Direct Sign-In in the Poppy 1.0 specification: an authorization code with <abbr title="Proof Key for Code Exchange">PKCE</abbr>, an agent that is identified by the web address of its own metadata file, and a signed client assertion in place of a client secret.

This is a stand-in, not a conforming Poppy store and not Drift Bean. It uses plain <abbr title="Hypertext Transfer Protocol">HTTP</abbr> on the loopback address, while the specification requires HTTPS. It has no Session header or User <abbr title="identifier">ID</abbr>s, no device sign-in, no pushed authorization requests and no token binding. It has one test account and keeps everything in memory. The playground cannot reach this local copy from the internet.

You need Node.js. Download both files, then start each in its own terminal:

```bash
curl -O https://iamops.dev/lab-files/poppy-playground-lab/store.mjs
curl -O https://iamops.dev/lab-files/poppy-playground-lab/agent.mjs
node store.mjs
```

```bash
node agent.mjs
```

The first start writes a random password for the test account `demo-shopper` into a file named `.demo-login`, next to the script. Open `http://localhost:4611` in a browser.

![Dark page of the demo personal agent with one button: Connect to Cedar Cup](https://iamops.dev/media/poppy-playground-lab/demo-1-agent.webp)

*The agent. It asks to connect and has no password field.*

The button sends the browser to the store. The password is typed on the store's page, so the agent never receives it.

![Cedar Cup sign-in page on the local demo store with the test username filled in and the password hidden](https://iamops.dev/media/poppy-playground-lab/demo-2-signin.webp)

*Sign-in, on the store's page. The test account only.*

The store then shows what the agent asks for. In this demo the permission to place orders starts unticked, which is my design choice, not a rule from the specification. I pressed Allow with it left that way.

![Consent page: cart and read orders ticked, placing orders unticked, with Allow and Decline buttons](https://iamops.dev/media/poppy-playground-lab/demo-3-consent.webp)

*Consent. Two permissions given, one held back.*

### What the agent could and could not do

The agent then ran its requests, including some that should fail.

![Agent result list: wrong audience and wrong PKCE verifier refused, cart accepted, placing an order refused with 403, access refused after revocation](https://iamops.dev/media/poppy-playground-lab/demo-4-result.webp)

*The run. Green was accepted, orange was refused by the store.*

![Terminal output of the demo agent: status codes for each request, from the wrong audience refusal to the failed refresh after revocation](https://iamops.dev/media/poppy-playground-lab/04-agent-run.webp)

*The same run in the terminal.*

- **Bad token requests were refused.** A client assertion addressed to the token endpoint got 401, because the audience has to be the issuer. A wrong PKCE verifier got 400.
- **The token carried only what I approved.** Its scope was `cart:write orders:read`.
- **Scopes were enforced at the store.** Adding to the cart worked, reading orders worked, and placing an order got 403.
- **Old and revoked tokens stopped working.** The used refresh token was refused, and after revocation both the access token and the newest refresh token were refused.

These results describe my demo code. They show what to test on a real store, not how any real store behaves.

### The same store on a public HTTPS address

I then put a temporary copy of the store on a public test address, as a Cloudflare Worker that keeps its data in a Durable Object. In this text the address is `https://store.example.com`. The agent stayed on my computer, with its public key registered in the store. The copy accepts only that agent and the playground, holds one test account and was set to stop answering after a few hours.

![Consent page of the public copy of Cedar Cup: it names the agent, the address it returns to, and two of three permissions ticked](https://iamops.dev/media/poppy-playground-lab/cloud-3-consent.webp)

*Consent on the public copy. The page also shows where the agent receives the answer.*

![Request log of the public store: discovery reads, sign-in, consent, token requests refused and accepted, API calls and revocation](https://iamops.dev/media/poppy-playground-lab/05-cloud-log.webp)

*The store's own log of the run.*

The run over HTTPS gave the same status codes as the local one. Within the first minute the new address also received a request for `/api/.env`, which the lab did not send. Treat any new public address as visible to scanners from the start.

The playground found a gap that my own run had missed. Its first Discovery run against this copy failed one check: section 4.1 of the specification requires a store to accept PS384 as well as ES256 for the agent's signature, and my store listed only ES256. I added PS384 to both copies. A local test accepted a correct PS384 signature and refused one made with the wrong salt length. The playground then passed all 20 checks it ran against the public copy. I did not complete a PS384 sign-in against the public copy.

![Poppy playground Discovery against my own public demo store: nothing failed, 20 checks passed, with the domain hidden](https://iamops.dev/media/poppy-playground-lab/dr-5-playground.webp)

*My store after the fix. 20 of 20 passed. The address is hidden.*

The [run guide and both programs](https://github.com/iamops-dev/lab-files/tree/main/poppy-sign-in) are in the lab files repository.

## What was not run

- **Placing an order, revoking access and replaying the token on Drift Bean.** None was tested. The 403 for a missing scope is what the store's policy says, and I did not trigger it there.
- **The expired delegation check.** The playground did not run it.
- **Device sign-in.** The store offers it, and I used the direct one.
- **Company Agent and task coverage.** The store does not offer them.
- **My demo store beyond Discovery.** In the playground it has no browser session, so the shopping step does not run there.

The Drift Bean results come from one test account on one evening. The scope refusals and revocation results come only from my own demo store.

## Limits

The `curl` reads reproduce 13 of the checks. The page's other checks depend on the playground's schema check, the tasks endpoint and live requests. I did not run those, so I cannot say whether they pass from another network or after a store change.

The playground's answers are a snapshot taken from 25 to 27 November 2026. The store file can change, and the checks run against a live demo. The agent's replies in step 2 can differ from run to run.

## Cleanup

Stop both programs with Ctrl+C. The store's data disappears with it. Delete the password file and unset the variables:

```bash
rm -f .demo-login
unset STORE PLAYGROUND ISSUER
```

The commands and the local demo create no account, app, token or key on another service. The signed-in run is different: it uses a Drift Bean test account, and the access given to the playground and the item in the cart were still there when I stopped. The Sign-in step has a <strong>Sign out and revoke</strong> button for the agent's access. I did not use it, so I report nothing about its result. Use it when you finish, and empty the cart on the store. I deleted the temporary public copy of my store, with its address and data, after the run.

*Written by Argo. The terminal output comes from the `curl` commands above, run on 27 November 2026 against public addresses; a first run with a script on 25 November 2026 gave the same values. Browser screenshots were taken on 26 and 27 November 2026. The signed-in pictures come from a test account on the sample store, with the account name and client identifier hidden. The demo store pictures and output come from my own copies, run on 27 November 2026 with generated test accounts.*

## Repeat this lab

The first steps need curl, jq and internet access, and make only GET requests to the public Poppy demo store, its sign-in server and the playground. The last steps need Node.js and run a store and an agent on your own computer with a generated test account. Plan for about 15 minutes.

Every value in angle brackets is a placeholder for your own test environment. Nothing on this page is a real identifier or secret.

**Set your variables once** `env.sh` (bash)

```bash
export STORE=https://driftbeandemo.com
export PLAYGROUND=https://poppyplayground.dev
```

### Step 1: Read the store's discovery file

**Goal.** Fetch the public discovery file and print the protocol version, the organization domain, the sign-in server and the scopes.

**Prerequisites**

- curl and jq

`store.sh` (bash)

```bash
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' "$STORE/.well-known/poppy.json"
curl -s "$STORE/.well-known/poppy.json" | jq '{protocol_version, domain: .organization.domain,
  issuer: .auth.issuer, scopes: (.auth.scopes | keys), apis: (.apis | length), web: (.web != null)}'
```

**Expected output**

```text
200 application/json
{"protocol_version": "1.0", "domain": "driftbeandemo.com", "issuer": "https://auth.driftbeandemo.com/",
 "scopes": ["cart:write", "orders:read", "orders:write", "poppy:browser-sign-in"], "apis": 1, "web": true}
```

### Step 2: Read the two metadata files

**Goal.** Read the store's protected resource metadata and the sign-in server metadata, and check the fields the 13 public-file checks use.

**Prerequisites**

- The store step has completed

`discovery.sh` (bash)

```bash
curl -s "$STORE/.well-known/oauth-protected-resource" | jq '{resource, authorization_servers}'
ISSUER=$(curl -s "$STORE/.well-known/poppy.json" | jq -r .auth.issuer)
curl -s "${ISSUER%/}/.well-known/oauth-authorization-server" | jq --arg iss "$ISSUER" --arg store "$STORE" '{
  issuer_matches: (.issuer == $iss), authorization_endpoint, device_authorization_endpoint, revocation_endpoint,
  authorization_code: (.grant_types_supported | index("authorization_code") != null),
  refresh_token: (.grant_types_supported | index("refresh_token") != null),
  browser_sign_in: (.scopes_supported | index("poppy:browser-sign-in") != null),
  protects_store: (.protected_resources | index($store) != null)}'
```

**Expected output**

```text
{"resource": "https://driftbeandemo.com", "authorization_servers": ["https://auth.driftbeandemo.com/"]}
{"issuer_matches": true, "authorization_endpoint": "https://auth.driftbeandemo.com/authorize",
 "device_authorization_endpoint": "https://auth.driftbeandemo.com/oauth/device/code",
 "revocation_endpoint": "https://auth.driftbeandemo.com/oauth/revoke",
 "authorization_code": true, "refresh_token": true, "browser_sign_in": true, "protects_store": true}
```

### Step 3: Check what the playground serves

**Goal.** Confirm the playground's Discovery page loads and that the playground publishes no discovery file of its own.

**Prerequisites**

- The discovery step has completed

`playground.sh` (bash)

```bash
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' "$PLAYGROUND/discovery"
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' "$PLAYGROUND/.well-known/poppy.json"
```

**Expected output**

```text
200 text/html; charset=utf-8
404 text/html; charset=utf-8
```

### Step 4: Start the local store and agent

**Goal.** Download both programs and start them. The store runs on port 4610 and the agent on port 4611.

**Prerequisites**

- Node.js
- Ports 4610 and 4611 are free

`demo-start.sh` (bash)

```bash
curl -s -O https://iamops.dev/lab-files/poppy-playground-lab/store.mjs
curl -s -O https://iamops.dev/lab-files/poppy-playground-lab/agent.mjs
node store.mjs &
node agent.mjs &
```

**Expected output**

```text
Cedar Cup on http://localhost:4610
test account demo-shopper; its password is in the file .demo-login
Demo agent on http://localhost:4611
```

### Step 5: Sign in and approve two permissions

**Goal.** Open the agent page, connect, sign in on the store page with the test account, leave the order permission unticked and allow.

**Prerequisites**

- Both programs are running

`demo-signin.sh` (bash)

```bash
cat .demo-login
# then open http://localhost:4611 in a browser
```

**Expected output**

```text
200  token request, correct assertion and verifier  scope="cart:write orders:read"
201  POST /api/cart  items=1
403  POST /api/orders  POST /api/orders needs orders:write
401  GET /api/cart after revoke  invalid_token
```

### Step 6: Clean up

**Goal.** Stop both programs, delete the test password file and unset the variables.

**Prerequisites**

- The earlier steps have completed

`cleanup.sh` (bash)

```bash
kill %1 %2
rm -f .demo-login
unset STORE PLAYGROUND ISSUER
```

**Expected output**

```text
(the two programs stop)
```


## Sources

- [Poppy developer playground (Discovery page, run against the Drift Bean demo store)](https://poppyplayground.dev/)
- [Drift Bean Demo, the store's discovery file](https://driftbeandemo.com/.well-known/poppy.json)
- [Personal Agent Protocol 1.0, specification](https://personalagentprotocol.org/docs/1.0/spec)
- [Poppy and Auth0: what a personal agent may do on your site (news article)](https://iamops.dev/poppy-personal-agent-protocol-auth0-beta/)

Discuss: [X](https://x.com/iamopsdev) | [LinkedIn](https://www.linkedin.com/company/iamops-dev/)
