Merge lp:~canonical-platform-qa/ubuntu-community-testing/fix-oauth-validation into lp:ubuntu-community-testing

Proposed by Christopher Lee
Status: Merged
Approved by: Christopher Lee
Approved revision: 32
Merged at revision: 32
Proposed branch: lp:~canonical-platform-qa/ubuntu-community-testing/fix-oauth-validation
Merge into: lp:ubuntu-community-testing
Diff against target: 19 lines (+9/-3)
1 file modified
ubuntu_pt_community/auth/sso.py (+9/-3)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-community-testing/fix-oauth-validation
Reviewer Review Type Date Requested Status
Ubuntu Testcase Admins Pending
Review via email: mp+273012@code.launchpad.net

Commit message

Fix error in validating oauth/sso request.

Description of the change

Fix error in validating oauth/sso request.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_pt_community/auth/sso.py'
2--- ubuntu_pt_community/auth/sso.py 2015-08-18 03:45:23 +0000
3+++ ubuntu_pt_community/auth/sso.py 2015-10-01 04:38:39 +0000
4@@ -62,6 +62,12 @@
5 SSO_BASE_URL + '/requests/validate', json.dumps(data),
6 headers=JSON_HEADERS)
7 if not validate_response.ok:
8- logger.error('Validation failed against login server.')
9- raise Unauthorized('Validation failed against login server.')
10- return validate_response.json()
11+ err_message = 'Validation request failed against login server.'
12+ logger.error(err_message)
13+ raise Unauthorized(err_message)
14+
15+ response_details = validate_response.json()
16+ if not response_details.get('is_valid', False):
17+ err_message = 'Validation failed against login server.'
18+ logger.error(err_message)
19+ raise Unauthorized(err_message)

Subscribers

People subscribed via source and target branches