@@ -94,9 +94,9 @@ The following combinations of attributes might be relevant for various scenarios
94
94
95
95
#. Plain frontend route: ``Controller `` class
96
96
#. Plain frontend with CRSF checks disabled: ``Controller `` class and ``#[NoCSRFRequired] `` attribute on the method
97
- #. REST route with CORS enabled: ``Controller `` class and ``#[CORS] `` and ``#[NoCSRFRequired] `` attributes on the route
98
- #. OCS-based route: ``OCSController `` class
99
- #. OCS-based route with CORS enabled: ``OCSController `` class and ``#[CORS] `` attribute on the method
97
+ #. Plain frontend route with CORS enabled: ``Controller `` class and ``#[CORS] `` and ``#[NoCSRFRequired] `` attributes on the route
98
+ #. OCS route: ``OCSController `` class
99
+ #. OCS route with CORS enabled: ``OCSController `` class and ``#[CORS] `` attribute on the method
100
100
101
101
.. warning ::
102
102
Adding the ``#[NoCRSFRequired] `` attribute imposes a security risk.
@@ -114,8 +114,8 @@ These ways depend on your API configuration (what you allow) and on which route
114
114
- *Access from web frontend * means the user is browses the Nextcloud web frontend with a browser.
115
115
- *Access from an external app * indicates that the user is not using the normal browser (as logged in) but directly navigates a certain URL.
116
116
This can be in a new browser tab or an external program (like an Android app or simply a curl command line).
117
- - *Access from external website * means that the user browses some third party web site and * magically * data from your app appears.
118
- Technically, the other website would embed/load/use images, JSON data, or other resources from a URL pointing to the Nextcloud server.
117
+ - *Access from external website * means that the user browses some third party web site and data from your Nextcloud server appears.
118
+ The other website has to embed/load/use images, JSON data, or other resources from a URL pointing to the Nextcloud server, to be able to do this .
119
119
120
120
.. list-table :: Comparison of different API types
121
121
:header-rows: 1
@@ -170,6 +170,6 @@ The only exception to this is if you want to provide an API for external usage w
170
170
Here, the encapsulation introduced in OCS and CSRF checks might be in your way.
171
171
172
172
.. [# ] Only if you have set ``#[NoCSRFRequired] ``.
173
- OCS controllers have other CSRF checks in place that might with CORS without disabling the CSRF checks completely.
174
- Using the ``OCS-APIREQUEST `` header is also a CSRF protection but is compatible with CORS.
175
- .. [# ] The OCS controller needs the request header ``OCS-APIREQUEST `` to be set to ``true ``.
173
+ OCS controllers have other CSRF checks in place that work with CORS without disabling the CSRF checks completely.
174
+ Using the ``OCS-APIRequest `` header is a CSRF protection which is compatible with CORS.
175
+ .. [# ] The OCS controller needs the request header ``OCS-APIRequest `` to be set to ``true ``.
0 commit comments