You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.
When I try to access the Khan API thru the flask test client, it says that it "expected a signature base string." I tried fixes I found in other issues but it still isn't working. Here's the error:
KeyError: "Decoder failed to handle oauth_token with data as returned by provider. A different decoder may be needed. Provider returned: b'OAuth error. Invalid signature. Expected signature base string: POST&https%3A%2F%2Fwww.khanacademy.org%2Fapi%2Fauth2%2Frequest_token&oauth_callback%3Dhttp%253A%252F%252Flocalhost%253A5000%252Foauth_callback%26oauth_consumer_key%3DMY-KEY%26oauth_nonce%3Df8cfed8b74ebfb911d733e2ea40e5076d9260ebe%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1565700706%26oauth_version%3D1.0'"
Here's my changed khan_api file. I only remember changing the http to https, but there may be more. {Server.py left unchanged}
"""This example script shows a possible method for integrating the Khan API intoa flask server"""fromrauthimportOAuth1Serviceimportrequestsfromflaskimporturl_for, request, redirect, sessionfromtimeimporttimeimportjson# You can get a CONSUMER_KEY and CONSUMER_SECRET for your app here:# http://www.khanacademy.org/api-apps/registerCONSUMER_KEY="MY KEY"CONSUMER_SECRET="MY SECRET"# Oauth configuration values described at:# https://github.com/Khan/khan-api/wiki/Khan-Academy-API-AuthenticationSERVER_URL="https://www.khanacademy.org"REQUEST_TOKEN_URL=SERVER_URL+"/api/auth2/request_token"ACCESS_TOKEN_URL=SERVER_URL+"/api/auth2/access_token"AUTHORIZE_URL=SERVER_URL+"/api/auth2/authorize"BASE_URL=SERVER_URL+"/api/auth2"
I have no idea what is going on. Doesn't work with PHP either (different error), but I'm not really interested in PHP.
The text was updated successfully, but these errors were encountered:
When I started the server I saw the exact same error. But when I applied your change (modified the SERVER_URL variable to use https instead of http) the issue was resolved. Are you still seeing this issue?
Hi there,
When I try to access the Khan API thru the flask test client, it says that it "expected a signature base string." I tried fixes I found in other issues but it still isn't working. Here's the error:
KeyError: "Decoder failed to handle oauth_token with data as returned by provider. A different decoder may be needed. Provider returned: b'OAuth error. Invalid signature. Expected signature base string: POST&https%3A%2F%2Fwww.khanacademy.org%2Fapi%2Fauth2%2Frequest_token&oauth_callback%3Dhttp%253A%252F%252Flocalhost%253A5000%252Foauth_callback%26oauth_consumer_key%3DMY-KEY%26oauth_nonce%3Df8cfed8b74ebfb911d733e2ea40e5076d9260ebe%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1565700706%26oauth_version%3D1.0'"
Here's my changed khan_api file. I only remember changing the http to https, but there may be more. {Server.py left unchanged}
I have no idea what is going on. Doesn't work with PHP either (different error), but I'm not really interested in PHP.
The text was updated successfully, but these errors were encountered: