LIME

Approve a site login request

Someone clicked Sign in with LIME on the site — the waiting screen shows login_request_id. You read the ID from that page and approve it. You never get the site JWT or cookie.

  • 20 min
  • Intermediate

Done when

The website can finish the browser sign-in; your agent holds no site session.

  • You approved the login_request_id shown on the waiting screen
  • LIME_AGENT_TOKEN stayed in the agent runtime
  • Cookie appears only after the site verifies SSE JWT

Run step 1

You need

  • LIME_AGENT_TOKEN in the private agent environment
  • login_request_id from the site waiting screen (after the button click)
  • Agent from the same LIME account as the site
  • lime-agents-sdk >= 1.0.0

Steps

  1. Read the ID from the waiting screen

    The agent is already in the browser on your site. Read login_request_id from the waiting UI — LIME will not push it to you.

    # Read from the waiting screen in the agent's browser — not a separate queue.
    request_id = page.read_text("#login-request-id")  # lr_…
    print(request_id)

    AssertYou hold login*request_id (lr*…) for that browser attempt.

  2. Approve with LimeAgent.login

    Call LimeAgent.login(request_id). The SDK solves PoW and posts approve so the site can finish the waiting page.

    import asyncio
    from lime_agents import LimeAgent
    
    LIME_AGENT_TOKEN = "LIME_AGENT_TOKEN_HERE"
    LOGIN_REQUEST_ID = "lr_xxxxxxxx"
    
    async def main() -> None:
        agent = LimeAgent(agent_token=LIME_AGENT_TOKEN)
        result = await agent.login(LOGIN_REQUEST_ID)
        print(result.status)
        await agent.aclose()
    
    asyncio.run(main())

    AssertApprove succeeds; site receives JWT over SSE next.

Protocol

Same LIME account

Approve works only when the agent and the site share one portal login. Cross-account approve returns 403 SITE_LOGIN_AGENT_USER_MISMATCH.

agent + site → one account on lime.pics

Verify

  • Assert: ID from waiting screen → LimeAgent.login → site waiting page completes.
  • Negative: agent from another portal account → 403 SITE_LOGIN_AGENT_USER_MISMATCH.
  • Negative: unknown or expired login_request_id → 404 / 409 from LIME.

Wire failures

ScopeStatusCodeWhenWhat to do
LIME API403SITE_LOGIN_AGENT_USER_MISMATCHAgent and site belong to different LIME accountsUse an agent from the same portal account as the site
LIME API404SITE_LOGIN_REQUEST_NOT_FOUNDlogin_request_id is unknownWait for a fresh ID on the waiting screen after the next Sign in with LIME click
LIME API400INVALID_POWPoW nonce is invalid (manual HTTP path)Prefer LimeAgent.login — the SDK solves PoW
LIME API400MISSING_POW_NONCEApprove body omits pow_nonceSend pow_nonce or use LimeAgent.login

Related API

Approve a site login request · LIME