docs/api/authenticating.md on api/v1.0 currently covers four ways to find a token you already have — create a guest account, log in with email and password, beam me, and snooping Portal in browser devtools. That set is inherently open-ended, and the page now says so ("the methods below are the most common").
What is missing is the genuinely closed set underneath it: the grant_type values the platform accepts. Nothing in the docs enumerates them, and the machine-readable reference cannot answer it either.
The set is closed and knowable
BeamableBackend, core/src/main/scala/com/disruptorbeam/clients/auth/AuthClient.scala, tokenRequest — a total match on grant_type.toLowerCase, with everything else falling through to InvalidGrantTypeError:
grant_type |
Required fields |
Notes |
guest |
none |
anonymous account creation; the one public, unauthenticated route |
password |
username, password |
developer accounts included |
refresh_token |
refresh_token |
|
third_party |
third_party, token |
ThirdPartyAuthProvider on WebSDK documents only Facebook and Google |
external |
provider_service, external_token; optional provider_namespace, challenge_solution |
this is Federated Identity |
device |
device_id |
note the value is device, not device_id — device_id is the field name |
authorization_code |
client_id, code, redirect_uri |
|
Seven, not the six one might recall from memory. authorization_code is easy to overlook, and the device / device_id distinction is exactly the kind of thing a reader cannot guess.
Why the OpenAPI reference does not cover it
docs/assets/beamable-oapi.json on api/v1.0 declares grant_type as bare {"type": "string"} with no enum. So the /basic/auth/token reference — the place that ought to be authoritative — does not constrain it, and the RapiDoc page renders a free-text field. The property set on TokenRequestWrapper hints at the families, but that is reverse-engineering a schema rather than reading documentation.
This is arguably the higher-leverage half of the fix: adding the enum to grant_type upstream in the OpenAPI generator would make the reference self-documenting for every consumer, not just for readers of the prose page. Worth checking with the SDK team whether that is cheap.
What exists today, scattered
- WebSDK
AuthService — four login param types (email, third-party, external identity, refresh token). SDK surface rather than grant types, and auto-generated, so not editable from this repo
- WebSDK
ThirdPartyAuthProvider — Facebook and Google only
- Unity
identity.md — RecoverAccountWithEmail and RecoverAccountWithThirdParty, then defers to "the individual sign in method pages"
- Unreal —
federated-login.md, identity.md, online-subsystem-identity.md
So per-engine how-tos partly exist; the API-level table that ties them together does not.
Proposed shape
A table on api/v1.0 like the one above — grant type, required fields, one-line purpose — with each row linking out to the per-engine how-to where one exists. That keeps the exhaustive list in one place (the API branch, where the grant types actually live) without duplicating per-engine instructions into it.
Open questions worth settling before writing:
- Is
authorization_code intended for external consumers, or is it internal-only plumbing? If internal, the table should say so rather than omit it
- Same question for
device — is device-ID auth a supported integration path or a legacy flow?
- Cross-branch links from
api/v1.0 into Unity-6.0 / Unreal-2.3 cross Mike version boundaries, so they must be absolute help.beamable.com URLs and will need revisiting as versions roll
Not bite-size
Seven types, an upstream OpenAPI change, and cross-branch linking. Deliberately unlabeled bite-size; the OpenAPI enum addition might be, if split out.
Surfaced while copyediting api/v1.0 for #127.
docs/api/authenticating.mdonapi/v1.0currently covers four ways to find a token you already have — create a guest account, log in with email and password,beam me, and snooping Portal in browser devtools. That set is inherently open-ended, and the page now says so ("the methods below are the most common").What is missing is the genuinely closed set underneath it: the
grant_typevalues the platform accepts. Nothing in the docs enumerates them, and the machine-readable reference cannot answer it either.The set is closed and knowable
BeamableBackend,core/src/main/scala/com/disruptorbeam/clients/auth/AuthClient.scala,tokenRequest— a totalmatchongrant_type.toLowerCase, with everything else falling through toInvalidGrantTypeError:grant_typeguestpasswordusername,passwordrefresh_tokenrefresh_tokenthird_partythird_party,tokenThirdPartyAuthProvideron WebSDK documents only Facebook and Googleexternalprovider_service,external_token; optionalprovider_namespace,challenge_solutiondevicedevice_iddevice, notdevice_id—device_idis the field nameauthorization_codeclient_id,code,redirect_uriSeven, not the six one might recall from memory.
authorization_codeis easy to overlook, and thedevice/device_iddistinction is exactly the kind of thing a reader cannot guess.Why the OpenAPI reference does not cover it
docs/assets/beamable-oapi.jsononapi/v1.0declaresgrant_typeas bare{"type": "string"}with noenum. So the/basic/auth/tokenreference — the place that ought to be authoritative — does not constrain it, and the RapiDoc page renders a free-text field. The property set onTokenRequestWrapperhints at the families, but that is reverse-engineering a schema rather than reading documentation.This is arguably the higher-leverage half of the fix: adding the
enumtogrant_typeupstream in the OpenAPI generator would make the reference self-documenting for every consumer, not just for readers of the prose page. Worth checking with the SDK team whether that is cheap.What exists today, scattered
AuthService— four login param types (email, third-party, external identity, refresh token). SDK surface rather than grant types, and auto-generated, so not editable from this repoThirdPartyAuthProvider— Facebook and Google onlyidentity.md—RecoverAccountWithEmailandRecoverAccountWithThirdParty, then defers to "the individual sign in method pages"federated-login.md,identity.md,online-subsystem-identity.mdSo per-engine how-tos partly exist; the API-level table that ties them together does not.
Proposed shape
A table on
api/v1.0like the one above — grant type, required fields, one-line purpose — with each row linking out to the per-engine how-to where one exists. That keeps the exhaustive list in one place (the API branch, where the grant types actually live) without duplicating per-engine instructions into it.Open questions worth settling before writing:
authorization_codeintended for external consumers, or is it internal-only plumbing? If internal, the table should say so rather than omit itdevice— is device-ID auth a supported integration path or a legacy flow?api/v1.0intoUnity-6.0/Unreal-2.3cross Mike version boundaries, so they must be absolutehelp.beamable.comURLs and will need revisiting as versions rollNot bite-size
Seven types, an upstream OpenAPI change, and cross-branch linking. Deliberately unlabeled
bite-size; the OpenAPIenumaddition might be, if split out.Surfaced while copyediting
api/v1.0for #127.