All docsStellar ControlMission control · by Stellar Systems v1.1.0

API Reference

Auth

How to sign in, and NATS credentials of follow-up.

POST/v1/auth/nats

NATS credentials#

NATS credentials of follow-up

Exchanges a checked OIDC token for a NATS user JWT valid auth.nats_ttl, signed with the account signing key, for the given user nkey. It may only subscribe to stellar.run.evt.>, stellar.alarm.evt.> and _INBOX.>, and publish nothing.

Request body application/jsonrequired

public_keyrequired

string

Public nkey of the user (U…) the credentials are for.

Responses

200The JWT and its expiry.application/json
jwtrequired

string

NATS user JWT.

expiresrequired

integer · int64

Expiry (seconds since the epoch).

400Invalid body or key: api::invalid-body, auth::invalid-key.application/json
errorsrequired

array of ErrorItem

Every error found.

ErrorItem · 3 fields
coderequired

string

Stable code.

messagerequired

string

Message for the operator.

help

string

Suggested fix.

401No token, or refused: auth::jwt-required, auth::invalid-token, auth::no-provider.application/json
errorsrequired

array of ErrorItem

Every error found.

ErrorItem · 3 fields
coderequired

string

Stable code.

messagerequired

string

Message for the operator.

help

string

Suggested fix.

503No account signing key: auth::no-signing-key.application/json
errorsrequired

array of ErrorItem

Every error found.

ErrorItem · 3 fields
coderequired

string

Stable code.

messagerequired

string

Message for the operator.

help

string

Suggested fix.

Request

curl -X POST "http://localhost:8080/v1/auth/nats" \
  -H "Content-Type: application/json" \
  -d '{
  "public_key": "string"
}'

Response

{
  "jwt": "string",
  "expires": 0
}
GET/v1/auth/config

Auth config#

How to sign in

The identity provider, the public clients of the web console and of the CLI (auth.issuer, auth.client_id, auth.cli_client_id, auth.organization), without identity: the console and stellar login ask it before signing in.

Responses

200The sign-in, if any.application/json
oidc

one of SignIn | null

Request

curl "http://localhost:8080/v1/auth/config"

Response

{
  "oidc": {
    "issuer": "string",
    "client_id": "string",
    "cli_client_id": "string",
    "organization": "string",
    "scopes": [
      "string"
    ]
  }
}
GET/v1/auth/me

Auth me#

Who calls

The identity of the caller as the API takes it: the subject and roles of a checked token, else those declared by X-Stellar-User and X-Stellar-Role where tokens are not required, else none. The web console asks it when it opens, to ask for an identity only when it has none.

Responses

200The caller, anonymous included.application/json
sub

string

Who calls: the subject of a checked token, or the identity declared; none: anonymous.

rolesrequired

array of string

Roles of the caller.

verifiedrequired

boolean

Whether the identity comes from a checked token.

requiredrequired

boolean

Whether this API takes checked tokens only (auth.required).

401A token refused, or none where tokens are required: auth::token-required, auth::invalid-token, auth::no-provider.application/json
errorsrequired

array of ErrorItem

Every error found.

ErrorItem · 3 fields
coderequired

string

Stable code.

messagerequired

string

Message for the operator.

help

string

Suggested fix.

Request

curl "http://localhost:8080/v1/auth/me"

Response

{
  "sub": "string",
  "roles": [
    "string"
  ],
  "verified": true,
  "required": true
}

↑↓ to moveEnter to open