atproto/auth

atproto session auth: exchange an identifier + password for session tokens via com.atproto.server.createSession, and refresh them via com.atproto.server.refreshSession.

Types

pub type SessionTokens {
  SessionTokens(
    did: String,
    handle: String,
    access_jwt: String,
    refresh_jwt: String,
  )
}

Constructors

  • SessionTokens(
      did: String,
      handle: String,
      access_jwt: String,
      refresh_jwt: String,
    )

Values

pub fn create_session(
  client: xrpc.Client,
  pds: String,
  identifier: String,
  password: String,
) -> Result(SessionTokens, xrpc.XrpcError)
pub fn refresh_session(
  client: xrpc.Client,
  pds: String,
  refresh_jwt: String,
) -> Result(SessionTokens, xrpc.XrpcError)

Exchange a refresh JWT for a fresh session (the refresh token is sent as the bearer credential, per com.atproto.server.refreshSession).

Search Document