Auto-indexing service and GraphQL API for AT Protocol Records quickslice.slices.network/
atproto gleam graphql

Admin authentication seems to be broken #3

open
opened by lemmaeof.gay edited

I'm currently testing out labelling functions on Quickslice, and I've run into an issue where my authentication seems to be insufficient for admin actions through an OAuth client. I'm trying to apply a label to an account via a Quickslice running on my local docker with the query exactly as it is in the tutorial:

mutation {
  createLabel(
    uri: "at://lexicon.store"
    val: "!suspend"
  ) {
    id
    uri
    val
    cts
  }
}

I have made sure I am OAuthing into Quickslice with my account (this instance should not be available on the open internet but tokens are elided nonetheless):

{
  "access_token":"RZpQD...jcYFM",
  "token_type":"Bearer",
  "expires_in":3600,
  "refresh_token":"axeYV...CjJVE",
  "scope":"atproto transition:generic",
  "sub":"did:plc:fxgreqfae3vqhyjsntsikfux"
}

I have made that same account an admin on my Quickslice instance:

Current Admins:
- did:plc:fxgreqfae3vqhyjsntsikfux
- did:plc:pz4sp2vf5w26wnaee253gfms

I am including the same access_token in my authentication:

Authorization: Bearer RZpQD...jcYFM

However, when I try to send that mutation to the /admin/graphql endpoint, I instead get this response:

{
  "data": {
    "createLabel": null
  },
  "errors": [
    {
      "message": "Authentication required",
      "path": [
        "createLabel"
      ]
    }
  ]
}

Is there something I'm obviously missing here? I can't see what would cause my clearly admin account that I am sending my active bearer token to authenticate with to not be properly authenticated as an admin. This is being done through a C# client so there aren't any other tokens or cookies, and I can't use the JS client API.

Thanks for reporting. Yeah I've been meaning to fix that. Currently you can only interact with the admin API via the {your_slice_instance}/graphiql/admin interface.

sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:fxgreqfae3vqhyjsntsikfux/sh.tangled.repo.issue/3mc2tpu6mbl22