{"action":"opened","issue":{"url":"https://api.github.com/repos/puiterwijk/flask-oidc/issues/49","repository_url":"https://api.github.com/repos/puiterwijk/flask-oidc","labels_url":"https://api.github.com/repos/puiterwijk/flask-oidc/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/puiterwijk/flask-oidc/issues/49/comments","events_url":"https://api.github.com/repos/puiterwijk/flask-oidc/issues/49/events","html_url":"https://github.com/puiterwijk/flask-oidc/issues/49","id":301778899,"number":49,"title":"Issues with how basic auth is being done when in Python 3","user":{"login":"ashic","id":565991,"avatar_url":"https://avatars2.githubusercontent.com/u/565991?v=4","gravatar_id":"","url":"https://api.github.com/users/ashic","html_url":"https://github.com/ashic","followers_url":"https://api.github.com/users/ashic/followers","following_url":"https://api.github.com/users/ashic/following{/other_user}","gists_url":"https://api.github.com/users/ashic/gists{/gist_id}","starred_url":"https://api.github.com/users/ashic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashic/subscriptions","organizations_url":"https://api.github.com/users/ashic/orgs","repos_url":"https://api.github.com/users/ashic/repos","events_url":"https://api.github.com/users/ashic/events{/privacy}","received_events_url":"https://api.github.com/users/ashic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-02T14:13:32Z","updated_at":"2018-03-02T14:13:32Z","closed_at":null,"author_association":"NONE","body":"I'm seeing a problem anywhere this library is using client secret basic as the auth mechanism. The issue boils down to:\r\n\r\n```\r\n bas = 'foo:bar'\r\n bytes = bytearray(bas, 'utf-8')\r\n s = 'Basic %s' % b64encode(bytes)\r\n s\r\n\"Basic b'Zm9vOmJhcg=='\"\r\n s2 = 'Basic %s' % b64encode(bytes).decode('utf-8')\r\n s2\r\n'Basic Zm9vOmJhcg=='\r\n```\r\nIn python 3.6.4, serializing bytes is outputting b'actual_value', which is then failing authentication. Adding a .decode('utf-8') results in a string, and the b'' isn't added anymore. This doesn't manifest in python 2. \r\n\r\nThe following works in both python 2 and 3:\r\n\r\n```\r\n bas = 'foo:bar'\r\n bytes = bytearray(bas, 'utf-8')\r\n s = str('Basic %s' % b64encode(bytes).decode('utf-8'))\r\n s\r\n```\r\nWould this be something you're willing to incorporate? I can get a PR ready for this if so. (I think this affects https://github.com/puiterwijk/flask-oidc/issues/44 as well).\r\n"}}
{"actor":{"display_login":"ashic"}}