From a0d833f03ada841c5dd37da62637cf1cbefcc782 Mon Sep 17 00:00:00 2001 From: Ilya Nikitenkov Date: Fri, 25 Jul 2025 14:55:39 +0300 Subject: [PATCH] Support OAuth authorization --- README.md | 2 +- lib/calendav/endpoint.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc6ba11..45de03f 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ credentials = Calendav::Credentials::Standard.new( host: "https://www.example.com/caldav", username: "example", password: "secret", - authentication: :basic_auth # or :bearer_token + authentication: :basic_auth # :bearer_token and :oauth also supported ) ``` diff --git a/lib/calendav/endpoint.rb b/lib/calendav/endpoint.rb index f021bb5..279b5c2 100644 --- a/lib/calendav/endpoint.rb +++ b/lib/calendav/endpoint.rb @@ -85,6 +85,8 @@ def authenticated HTTP.basic_auth(user: credentials.username, pass: credentials.password) when :bearer_token HTTP.auth("Bearer #{credentials.password}") + when :oauth + HTTP.auth("OAuth #{credentials.password}") else raise "Unexpected authentication approach: " \ "#{credentials.authentication}"