Changeset

5392:c0a6f39caf47

mod_http_oauth2: Fix missing base64 part of base64url (Thanks KeyCloak) Obligatory bugs in untested code.
author Kim Alvefur <zash@zash.se>
date Sun, 30 Apr 2023 16:42:04 +0200
parents 5391:4aedce4fb95d
children 5393:9b9d612f9083
files mod_http_oauth2/mod_http_oauth2.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Sun Apr 30 16:41:30 2023 +0200
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Sun Apr 30 16:42:04 2023 +0200
@@ -18,7 +18,7 @@
 local st = require "util.stanza";
 
 local function b64url(s)
-	return (s:gsub("[+/=]", { ["+"] = "-", ["/"] = "_", ["="] = "" }))
+	return (base64.encode(s):gsub("[+/=]", { ["+"] = "-", ["/"] = "_", ["="] = "" }))
 end
 
 local function read_file(base_path, fn, required)