-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jozef Volak
committed
Feb 10, 2022
1 parent
4ecc7fa
commit 05bb1d7
Showing
3 changed files
with
40 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function swagger_auth_modal(r,jwt,scope,client_id) | ||
local body = r:body() | ||
if jwt == "true" then | ||
-- change token request to id_token | ||
body = body:gsub("response_type=token", "response_type=id_token"); | ||
-- -- -- disable client_id input box and use default | ||
body = body:gsub("||A===x", ""); | ||
body = body:gsub('client_id="%+encodeURIComponent%(p%)', 'client_id=' .. client_id .. '"'); | ||
-- -- -- -- disable scopes selection and use default, add nonce query parameter | ||
body = body:gsub('O=o.get%("allowedScopes"%)||o.get%("scopes"%),', ""); | ||
body = body:gsub('T%(%)%(c%)%?m%=c:F.a.List.isList%(c%)&&%(m=c.toArray%(%)%),m.length%>0', "true"); | ||
body = body:gsub('scope="%+encodeURIComponent%(m.join%(v%)%)', 'scope=' .. scope .. '&nonce=678910"'); | ||
r:headers('Content-Length', tostring(body:len())) | ||
end | ||
return body | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters