ePostman docs
PortálConsole

AutentifikáciaAuthentication

OAuth 2.0 s grantom client_credentials, povinné hlavičky a životný cyklus tokenu.OAuth 2.0 with the client_credentials grant, required headers and the token lifecycle.

1 min čítania1 min read
  • #oauth
  • #client credentials
  • #token
  • #x-peppol-participant-id
  • #sapi-auth-005
  • #oauth
  • #client credentials
  • #token
  • #x-peppol-participant-id
  • #sapi-auth-005

OAuth 2.0 s grantom client_credentials. Bez prehliadača, bez presmerovaní.

Povinné hlavičky

HlavičkaKdePopis
AuthorizationvšadeBearer <access_token> z /sapi/auth/token.
X-Peppol-Participant-Id/sapi/document/*Váš identifikátor vo formáte {schéma}:{id}, napr. 0245:2020317068 — pri schéme 0245 je identifikátorom desaťmiestne DIČ. Musí patriť tej istej organizácii ako token.
Idempotency-Key/sapi/document/sendUUID, ktoré si vygenerujete vy. Platí 24 hodín.

Životný cyklus tokenu

Prístupový token
15 minút
Obnovovací token
7 dní
Signál na obnovu
3 min pred koncom
Zamknutie účtu
15 minút

Token si cachujte a obnovujte až tesne pred expiráciou. Endpoint /sapi/auth/token/status vám povie, či je čas na obnovu — príznak should_refresh sa zapne tri minúty pred koncom platnosti. Pri obnove sa rotuje aj obnovovací token, takže si vždy uložte ten nový.

OAuth 2.0 with the client_credentials grant. No browser, no redirects.

Required headers

HeaderWhereDescription
AuthorizationeverywhereBearer <access_token> from /sapi/auth/token.
X-Peppol-Participant-Id/sapi/document/*Your identifier as {scheme}:{id}, e.g. 0245:2020317068 — under scheme 0245 the identifier is the ten-digit Slovak DIČ. It must belong to the same organisation as the token.
Idempotency-Key/sapi/document/sendA UUID you generate. Valid for 24 hours.

Token lifecycle

Access token
15 min
Refresh token
7 days
Refresh signal
3 min before expiry
Account lockout
15 min

Cache the token and refresh it only near expiry. /sapi/auth/token/status tells you when — the should_refresh flag flips on three minutes before it expires. A renewal also rotates the refresh token, so always store the new one.