typescript - How to Create a Callback Page for `atproto`'s OAuth client Using `@atprotooauth-client-browser`? - Stack Ov

admin2025-04-17  2

I'm trying to set up a callback page for atproto's OAuth flow( to be more specific, a callback page for popup logins ). The login step is already completed, but since this is my first time making a callback page, it isn't working at all.

Context

atproto is a decentralized protocol developed by BlueSky for large-scale social web applications. Due to its decentralized nature, its OAuth system works differently. Here’s the spec for atproto's OAuth system.

The Issue

I couldn't find any examples specifically for a simple SPA using @atproto/oauth-client-browser. Most guides either use native fetch or @atproto/oauth-client-node.

Does anyone know of a good guide or example for handling the callback step in a plain HTML/TypeScript setup?

Notes

  • Libraries: @atproto/oauth-client-browser, @atproto/api
  • Language: TypeScript
  • Callback Page Structure: Plain HTML
  • Client Metadata:
    {
        "client_id": ".json",
        "client_uri": ";,
        "redirect_uris": [".html"],
        "scope": "atproto transition:generic",
        "grant_types": ["authorization_code", "refresh_token"],
        "response_types": ["code"],
        "token_endpoint_auth_method": "none",
        "application_type": "web",
        "dpop_bound_access_tokens": true
    }
    
转载请注明原文地址:http://anycun.com/QandA/1744855159a88565.html