Skip to content

Commit

Permalink
add decoding of authorization header
Browse files Browse the repository at this point in the history
  • Loading branch information
htl-leonding committed Sep 29, 2024
1 parent bc2650c commit a8b8e15
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
28 changes: 28 additions & 0 deletions asciidocs/docs/http-filter-auth.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ GET http://localhost:8080/hello
Authorization: Basic am9objpkb2U=
----
.gesendeter GET-Request (Tools | HTTP Client | 'Show HTTP Requests History')
----
GET http://localhost:8080/hello
Authorization: Basic am9objpkb2U=
User-Agent: IntelliJ HTTP Client/IntelliJ IDEA 2024.3 EAP
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: */*
content-length: 0
----
.Im Server-Log gibt es nun folgende Einträge
----
2024-09-28 18:16:37,704 INFO [at.htl.aut.AuthenticationFilter] (executor-thread-1) Container Request Filter for authentication - Wer bin ich?
Expand Down Expand Up @@ -251,6 +262,15 @@ GET http://localhost:8080/hello
Authorization: Basic am9objpkb2U=
----
.Response
----
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
content-length: 14

Hello RESTEasy
----
.Im Server-Log gibt es nun folgende Einträge
----
2024-09-28 20:40:29,403 INFO [at.htl.aut.AuthenticationFilter] (executor-thread-1) Container Request Filter for authentication - Wer bin ich?
Expand All @@ -264,6 +284,14 @@ Authorization: Basic am9objpkb2U=
GET http://localhost:8080/hello
----
.Response
----
HTTP/1.1 401 Unauthorized
content-length: 0

<Response body is empty>
----
.Im Server-Log gibt es nun folgende Einträge
----
2024-09-29 06:16:03,656 INFO [at.htl.aut.AuthenticationFilter] (executor-thread-1) Container Request Filter for authentication - Wer bin ich?
Expand Down
5 changes: 3 additions & 2 deletions labs/http-filter-auth/http-requests/requests.http
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
### 1 GET /hello ohne auth

GET http://localhost:8080/hello
Content-Type: */*

###
### 2 GET /hello mit auth

# echo -n "john:doe" | base64
GET http://localhost:8080/hello
Authorization: Basic am9objpkb2U=

###


0 comments on commit a8b8e15

Please sign in to comment.