Comparison

mod_http_oauth2/mod_http_oauth2.lua @ 5239:8620a635106e

mod_http_oauth2: Validate basic URI syntax of redirect URIs
author Kim Alvefur <zash@zash.se>
date Sat, 11 Mar 2023 22:30:58 +0100
parent 5237:3354f943c1fa
child 5240:001908044d0d
comparison
equal deleted inserted replaced
5238:94472eb41d0a 5239:8620a635106e
598 598
599 if not schema.validate(registration_schema, client_metadata) then 599 if not schema.validate(registration_schema, client_metadata) then
600 return oauth_error("invalid_request", "Failed schema validation."); 600 return oauth_error("invalid_request", "Failed schema validation.");
601 end 601 end
602 602
603 for _, redirect_uri in ipairs(client_metadata.redirect_uris) do
604 local components = url.parse(redirect_uri);
605 if not components then
606 return oauth_error("invalid_request", "Invalid redirect URI.");
607 end
608 end
609
603 -- Ensure each signed client_id JWT is unique 610 -- Ensure each signed client_id JWT is unique
604 client_metadata.nonce = uuid.generate(); 611 client_metadata.nonce = uuid.generate();
605 612
606 -- Do we want to keep everything? 613 -- Do we want to keep everything?
607 local client_id = jwt_sign(client_metadata); 614 local client_id = jwt_sign(client_metadata);