mod_http_oauth2/mod_http_oauth2.lua
changeset 5395 4aedce4fb95d
parent 5394 f2363e6d9a64
child 5396 c0a6f39caf47
equal deleted inserted replaced
5394:f2363e6d9a64 5395:4aedce4fb95d
   399 	return code_verifier;
   399 	return code_verifier;
   400 end
   400 end
   401 
   401 
   402 function verifier_transforms.S256(code_verifier)
   402 function verifier_transforms.S256(code_verifier)
   403 	-- code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))
   403 	-- code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))
   404 	return code_verifier and b64url(hashes.SHA256(code_verifier));
   404 	return code_verifier and b64url(hashes.sha256(code_verifier));
   405 end
   405 end
   406 
   406 
   407 -- Used to issue/verify short-lived tokens for the authorization process below
   407 -- Used to issue/verify short-lived tokens for the authorization process below
   408 local new_user_token, verify_user_token = jwt.init("HS256", random.bytes(32), nil, { default_ttl = 600 });
   408 local new_user_token, verify_user_token = jwt.init("HS256", random.bytes(32), nil, { default_ttl = 600 });
   409 
   409