Skip to content

Commit

Permalink
Moved service authentication example to documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-crowhurst committed Apr 8, 2018
1 parent 3932eb7 commit 7764563
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
@@ -1,13 +1,12 @@
/*
* Example illustrating HTTP Basic service authentication.
*
* Server Usage:
* ./distribution/example/basic_authentication
*
* Client Usage:
* curl -w'\n' -v -XGET 'http://Corvusoft:Glasgow@localhost:1984/resource'
*/
Overview
--------

"HTTP Basic authentication (BA) implementation is the simplest technique for enforcing access controls to web resources because it does not require cookies, session identifiers, or login pages; rather, HTTP Basic authentication uses standard fields in the HTTP header, removing the need for handshakes." -- [Wikipedia](https://en.wikipedia.org/wiki/Basic_access_authentication)

Example
-------

```C++
#include <memory>
#include <cstdlib>
#include <ciso646>
Expand Down Expand Up @@ -55,3 +54,16 @@ int main( const int, const char** )

return EXIT_SUCCESS;
}
```
Build
-----
> $ clang++ -o example example.cpp -l restbed
Execution
---------
> $ ./example
>
> $ curl -w'\n' -v -XGET 'http://Corvusoft:Glasgow@localhost:1984/resource'
3 changes: 0 additions & 3 deletions example/CMakeLists.txt
Expand Up @@ -10,9 +10,6 @@ set( EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/example" )
#
# Build
#
add_executable( basic_authentication basic_authentication/source/example.cpp )
target_link_libraries( basic_authentication ${STATIC_LIBRARY_NAME} )

add_executable( custom_status_codes custom_status_codes/source/example.cpp )
target_link_libraries( custom_status_codes ${STATIC_LIBRARY_NAME} )

Expand Down

0 comments on commit 7764563

Please sign in to comment.