Comparison

mod_http_oauth2/mod_http_oauth2.lua @ 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
parent 5391:4aedce4fb95d
child 5393:9b9d612f9083
comparison
equal deleted inserted replaced
5391:4aedce4fb95d 5392:c0a6f39caf47
16 local it = require "util.iterators"; 16 local it = require "util.iterators";
17 local array = require "util.array"; 17 local array = require "util.array";
18 local st = require "util.stanza"; 18 local st = require "util.stanza";
19 19
20 local function b64url(s) 20 local function b64url(s)
21 return (s:gsub("[+/=]", { ["+"] = "-", ["/"] = "_", ["="] = "" })) 21 return (base64.encode(s):gsub("[+/=]", { ["+"] = "-", ["/"] = "_", ["="] = "" }))
22 end 22 end
23 23
24 local function read_file(base_path, fn, required) 24 local function read_file(base_path, fn, required)
25 local f, err = io.open(base_path .. "/" .. fn); 25 local f, err = io.open(base_path .. "/" .. fn);
26 if not f then 26 if not f then