def test_correct_code_challenge_method_s256(self): # "abcd" as verifier gives a '+' to base64 self.assertTrue( authorization_code.code_challenge_method_s256( "abcd", "iNQmb9TmM40TuEX88olXnSCciXgjuSF9o-Fhk28DFYk")) # "/" as verifier gives a '/' and '+' to base64 self.assertTrue( authorization_code.code_challenge_method_s256( "/", "il7asoJjJEMhngUeSt4tHVu8Zxx4EFG_FDeJfL3-oPE")) # Example from PKCE RFCE self.assertTrue( authorization_code.code_challenge_method_s256( "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk", "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM"))
def test_correct_code_challenge_method_s256(self): # "abcd" as verifier gives a '+' to base64 self.assertTrue( authorization_code.code_challenge_method_s256("abcd", "iNQmb9TmM40TuEX88olXnSCciXgjuSF9o-Fhk28DFYk") ) # "/" as verifier gives a '/' and '+' to base64 self.assertTrue( authorization_code.code_challenge_method_s256("/", "il7asoJjJEMhngUeSt4tHVu8Zxx4EFG_FDeJfL3-oPE") ) # Example from PKCE RFCE self.assertTrue( authorization_code.code_challenge_method_s256("dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk", "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM") )
def test_wrong_code_challenge_method_s256(self): self.assertFalse( authorization_code.code_challenge_method_s256("foo", "bar"))
def test_wrong_code_challenge_method_s256(self): self.assertFalse(authorization_code.code_challenge_method_s256("foo", "bar"))