Skip to content

Commit d17c747

Browse files
committed
use bearer token for auth
1 parent 0390b93 commit d17c747

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Examples/quoteapi/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ local:
2020
swift run QuoteService
2121

2222
local-invoke:
23-
curl -v -H 'Authorization: 123' -X POST --data @events/GetQuote.json http://127.0.0.1:7000/invoke
23+
curl -v -H 'Authorization: Bearer 123' -X POST --data @events/GetQuote.json http://127.0.0.1:7000/invoke
2424

2525
invoke:
26-
## curl -v -H 'Authorization: 123' https://<REPLACE_WITH_YOUR_API_URI>/stocks/AAPL
27-
curl -v -H 'Authorization: 123' https://lq2rria2n6.execute-api.us-east-1.amazonaws.com/stocks/AAPL
26+
## curl -v -H 'Authorization: Bearer 123' https://<REPLACE_WITH_YOUR_API_URI>/stocks/AAPL
27+
curl -v -H 'Authorization: Bearer 123' https://lq2rria2n6.execute-api.us-east-1.amazonaws.com/stocks/AAPL
2828

2929
###################### No Change required below this line ##########################
3030

Examples/quoteapi/Sources/LambdaAuthorizer/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ let simpleAuthorizerHandler:
7878
context.logger.debug("+++ Simple Authorizer called +++")
7979

8080
guard let authToken = request.headers["authorization"],
81-
authToken == "123"
81+
authToken == "Bearer 123"
8282
else {
8383
context.logger.warning("Missing or invalid Authorization header")
8484
return .init(isAuthorized: false, context: [:])

0 commit comments

Comments
 (0)