Skip to content

Commit 96d3460

Browse files
nikitenichpat
authored andcommitted
Support OAuth authorization
1 parent f33eb63 commit 96d3460

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ credentials = Calendav::Credentials::Standard.new(
2323
host: "https://www.example.com/caldav",
2424
username: "example",
2525
password: "secret",
26-
authentication: :basic_auth # or :bearer_token
26+
authentication: :basic_auth # :bearer_token and :oauth also supported
2727
)
2828
```
2929

lib/calendav/endpoint.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def authenticated
8585
HTTP.basic_auth(user: credentials.username, pass: credentials.password)
8686
when :bearer_token
8787
HTTP.auth("Bearer #{credentials.password}")
88+
when :oauth
89+
HTTP.auth("OAuth #{credentials.password}")
8890
else
8991
raise "Unexpected authentication approach: " \
9092
"#{credentials.authentication}"

0 commit comments

Comments
 (0)