Skip to content

Commit f0fa032

Browse files
ElienVandermaesenVITOsoxofaan
authored andcommitted
issue #685 move documentation of basic authentication under the OIDC documentation
1 parent fba4ef9 commit f0fa032

File tree

1 file changed

+46
-45
lines changed

1 file changed

+46
-45
lines changed

docs/auth.rst

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,6 @@ we start form a back-end connection::
2222

2323
connection = openeo.connect("https://openeo.example.com")
2424

25-
Basic HTTP Auth
26-
===============
27-
28-
Let's start with the easiest authentication method,
29-
based on the Basic HTTP authentication scheme.
30-
It is however *not recommended* for various reasons,
31-
such as its limited *security* measures.
32-
For example, if you are connecting to a back-end with a ``http://`` URL
33-
instead of a ``https://`` one, you should certainly not use basic HTTP auth.
34-
35-
With these security related caveats out of the way, you authenticate
36-
using your username and password like this::
37-
38-
connection.authenticate_basic("john", "j0hn123")
39-
40-
Subsequent usage of the connection object ``connection`` will
41-
use authenticated calls.
42-
For example, show information about the authenticated user::
43-
44-
>>> connection.describe_account()
45-
{'user_id': 'john'}
46-
47-
4825

4926
OpenID Connect Based Authentication
5027
===================================
@@ -90,7 +67,7 @@ in the context of working with openEO:
9067
* :ref:`authenticate_oidc_refresh_token`
9168

9269

93-
OpenID Connect is clearly more complex than Basic HTTP Auth.
70+
9471
In the sections below we will discuss the practical details of each flow.
9572

9673
General options
@@ -323,6 +300,29 @@ For example:
323300
>>> connection.authenticate_oidc()
324301
<Connection to 'https://openeo.example.com/openeo/1.1/' with OidcBearerAuth>
325302
303+
Basic HTTP Auth
304+
===============
305+
306+
The easiest authentication method is
307+
based on the Basic HTTP authentication scheme.
308+
It is however *not recommended* for various reasons,
309+
such as its limited *security* measures.
310+
For example, if you are connecting to a back-end with a ``http://`` URL
311+
instead of a ``https://`` one, you should certainly not use basic HTTP auth.
312+
313+
With these security related caveats out of the way, you authenticate
314+
using your username and password like this::
315+
316+
connection.authenticate_basic("john", "j0hn123")
317+
318+
Subsequent usage of the connection object ``connection`` will
319+
use authenticated calls.
320+
For example, show information about the authenticated user::
321+
322+
>>> connection.describe_account()
323+
{'user_id': 'john'}
324+
325+
326326
327327
328328
@@ -403,27 +403,6 @@ the current configuration and stored refresh tokens, e.g.::
403403
The sensitive information (like passwords) are redacted by default.
404404
405405
406-
407-
Basic HTTP Auth config
408-
-----------------------
409-
410-
With the ``add-basic`` subcommand you can add Basic HTTP Auth credentials
411-
for a given back-end to the config.
412-
It will interactively ask for username and password and
413-
try if these credentials work::
414-
415-
$ openeo-auth add-basic https://openeo.example.com/
416-
Enter username and press enter: john
417-
Enter password and press enter:
418-
Trying to authenticate with 'https://openeo.example.com'
419-
Successfully authenticated 'john'
420-
Saved credentials to '/home/john/.config/openeo-python-client/auth-config.json'
421-
422-
Now you can authenticate in your application without having to
423-
specify username and password explicitly::
424-
425-
connection.authenticate_basic()
426-
427406
OpenID Connect configs
428407
-----------------------
429408
@@ -472,6 +451,28 @@ For example::
472451
473452
474453
454+
Basic HTTP Auth config
455+
-----------------------
456+
457+
With the ``add-basic`` subcommand you can add Basic HTTP Auth credentials
458+
for a given back-end to the config.
459+
It will interactively ask for username and password and
460+
try if these credentials work::
461+
462+
$ openeo-auth add-basic https://openeo.example.com/
463+
Enter username and press enter: john
464+
Enter password and press enter:
465+
Trying to authenticate with 'https://openeo.example.com'
466+
Successfully authenticated 'john'
467+
Saved credentials to '/home/john/.config/openeo-python-client/auth-config.json'
468+
469+
Now you can authenticate in your application without having to
470+
specify username and password explicitly::
471+
472+
connection.authenticate_basic()
473+
474+
475+
475476
.. _default_url_and_auto_auth:
476477
477478
Default openEO back-end URL and auto-authentication

0 commit comments

Comments
 (0)