File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 4848 ] ;
4949 } ;
5050 environment . systemPackages = with pkgs ; [
51- xmlstarlet
52- html-tidy
51+ htmlq
5352 jq
5453 ] ;
5554 } ;
@@ -151,16 +150,14 @@ let
151150 # post url.
152151 keycloak.succeed(
153152 "curl -sSf -c cookie '${ frontendUrl } /realms/${ realm . realm } /protocol/openid-connect/auth?client_id=${ client . name } &redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=openid+email&response_type=code&response_mode=query&nonce=qw4o89g3qqm' >login_form",
154- "tidy -asxml -q -m login_form || true",
155- "xml sel -T -t -m \"_:html/_:body/_:div/_:div/_:div/_:div/_:div/_:div/_:form[@id='kc-form-login']\" -v @action login_form >form_post_url",
153+ "htmlq '#kc-form-login' --attribute action --filename login_form --output form_post_url"
156154 )
157155
158156 # Post the login form and save the response. Once again tidy up
159157 # the HTML, then extract the authorization code.
160158 keycloak.succeed(
161159 "curl -sSf -L -b cookie -d 'username=${ user . username } ' -d 'password=${ password } ' -d 'credentialId=' \"$(<form_post_url)\" >auth_code_html",
162- "tidy -asxml -q -m auth_code_html || true",
163- "xml sel -T -t -m \"_:html/_:body/_:div/_:div/_:div/_:div/_:div/_:input[@id='code']\" -v @value auth_code_html >auth_code",
160+ "htmlq '#code' --attribute value --filename auth_code_html --output auth_code"
164161 )
165162
166163 # Exchange the authorization code for an access token.
You can’t perform that action at this time.
0 commit comments