-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! 📝(project) add a ralph lrs tutorial
- Loading branch information
Showing
14 changed files
with
203 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# HTTP Basic Authentication | ||
|
||
The default method for securing Ralph API server is with HTTP basic authentication. For this, we need to create a user in Ralph LRS. | ||
The default method for securing the Ralph API server is HTTP Basic Authentication. | ||
For this, we need to create a user in Ralph LRS. | ||
|
||
## Creating user credentials | ||
|
||
|
@@ -10,31 +11,30 @@ To create a new user credentials, Ralph CLI provides a dedicated command: | |
|
||
```bash | ||
ralph auth \ | ||
--write-to-disk \ | ||
--username janedoe \ | ||
--password supersecret \ | ||
--scope janedoe_scope \ | ||
--agent-ifi-mbox mailto:[email protected] \ | ||
# or --agent-ifi-mbox-sha1sum ebd31e95054c018b10727ccffd2ef2ec3a016ee9 \ | ||
# or --agent-ifi-openid "http://jane.openid.example.org/" \ | ||
# or --agent-ifi-account exampleAccountname http://www.exampleHomePage.com \ | ||
-w | ||
--scope statements/write \ | ||
--scope statements/read \ | ||
--agent-ifi-mbox mailto:[email protected] | ||
``` | ||
|
||
=== "Docker Compose" | ||
|
||
```bash | ||
docker compose run --rm lrs \ | ||
bin/ralph auth \ | ||
ralph auth \ | ||
--write-to-disk \ | ||
--username janedoe \ | ||
--password supersecret \ | ||
--scope janedoe_scope \ | ||
--agent-ifi-mbox mailto:[email protected] \ | ||
# or --agent-ifi-mbox-sha1sum ebd31e95054c018b10727ccffd2ef2ec3a016ee9 \ | ||
# or --agent-ifi-openid "http://jane.openid.example.org/" \ | ||
# or --agent-ifi-account exampleAccountname http://www.exampleHomePage.com \ | ||
-w | ||
--scope statements/write \ | ||
--scope statements/read \ | ||
--agent-ifi-mbox mailto:[email protected] | ||
``` | ||
|
||
!!! tip | ||
You can either display the helper with `ralph auth --help` or check the CLI tutorial [here](../../cli.md) | ||
|
||
This command updates your credentials file with the new `janedoe` user. | ||
Here is the file that has been created by the `ralph auth` command: | ||
|
||
|
@@ -104,7 +104,7 @@ and running the Ralph LRS with: | |
docker compose up -d lrs | ||
``` | ||
|
||
we can try to make a request to the `whoami` endpoint again, but this time sending our username and password through Basic Auth: | ||
we can request the `whoami` endpoint again, but this time sending our username and password through Basic Auth: | ||
|
||
=== "curl" | ||
|
||
|
Oops, something went wrong.