From 95b967a94a7412c055e4fcb6b10ce9fff27b60ef Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 24 Nov 2023 11:59:37 +0100 Subject: [PATCH] add documentation about authentication options Signed-off-by: Bjoern Schiessle --- .../client_apis/OCS/ocs-api-overview.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/developer_manual/client_apis/OCS/ocs-api-overview.rst b/developer_manual/client_apis/OCS/ocs-api-overview.rst index 14b4564dba7..3696b2c7927 100644 --- a/developer_manual/client_apis/OCS/ocs-api-overview.rst +++ b/developer_manual/client_apis/OCS/ocs-api-overview.rst @@ -6,6 +6,24 @@ This document provides a quick overview of the OCS API endpoints supported in Ne All requests need to provide authentication information, either as a Basic Auth header or by passing a set of valid session cookies, if not stated otherwise. +Authentication +-------------- + +Authentication can happen either via username / password (or app token) or with OIDC tokens, see the examples below: + + +Username/Password: + +.. code-block:: bash + + curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "OCS-APIRequest: true" + + +OIDC Token: + +.. code-block:: bash + + curl -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "OCS-APIRequest: true" -H "Authorization: Bearer ID_TOKEN" Testing requests with curl --------------------------