-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Two outputs To merge https://github.com/ttrushin/node-red-contrib-basicauth/ which is abandoned ttrushin/node-red-contrib-basicauth#1 * Update node-red-contrib-mock-cli * Add msg.username * Add error messages * Update documentation * Fix realm * Readme outputs
- Loading branch information
Showing
7 changed files
with
95 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ curl 'https://test:[email protected]/basic-auth-demo' | |
|
||
There are three types of configuration: | ||
|
||
1. *Simple*: each node has it’s own credentials. (one credential) | ||
1. *Simple*: each node has its own credentials. (one credential) | ||
2. *Multiple credentials*: credentials shared with multiple nodes. (multiple credentials) | ||
3. *File with multiple credentials*: the user credentials are stored in a file. (multiple credentials) | ||
|
||
|
@@ -57,6 +57,35 @@ user1:test | |
user2:$2y$10$5TSZDldoJ7MxDZdtK/SG2O3cwORqLDhHabYlKX9OsM.W/Z/oLwKW6 | ||
``` | ||
|
||
## Outputs | ||
|
||
The first node output is used when the authentication succeeded, and it contains the username: | ||
|
||
```json | ||
"msg": { | ||
"realm": "node-red", | ||
"username": "alice", | ||
"req": "...", | ||
"res": "...", | ||
"...": "..." | ||
} | ||
``` | ||
|
||
The second node output is used when the authentication failed, and it contains error information: | ||
|
||
```json | ||
"msg": { | ||
"realm": "node-red", | ||
"username": "", | ||
"authError": "Unknown user 'test'", | ||
"req": "...", | ||
"res": "...", | ||
"...": "..." | ||
} | ||
``` | ||
|
||
Both outputs contain the `req` object, which can be inspected for detailed information about HTTP request headers, IP address, URL, etc. | ||
|
||
## Hints | ||
|
||
Here are examples to create hashed passwords: | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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