-
Notifications
You must be signed in to change notification settings - Fork 55
Switch to code authorization flow #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just two small comments
dist/origin-web-common-services.js
Outdated
// Handle an error response from the OAuth server | ||
if (params.error) { | ||
var error_description = params.error_description; | ||
var error_uri = params.error_uri; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nit, but it's odd to have local vars for these two and not params.error
. Also I generally avoid var
declarations inside an if
since they're not block scope. Suggest using params.error_description
without the local vars.
dist/origin-web-common-services.js
Outdated
then: stateData.then, | ||
verified: stateData.verified | ||
}); | ||
return deferred.promise; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be
if (params.access_token) {
return $q.when({
token: params.access_token,
...
});
}
updated |
dist/origin-web-common-services.js
Outdated
@@ -2893,7 +2908,37 @@ angular.module('openshiftCommonServices') | |||
// Returns a promise that resolves with {token:'...',then:'...',verified:true|false}, or rejects with {error:'...'[,error_description:'...',error_uri:'...']} | |||
// If no token and no error is present, resolves with {} | |||
// Example error codes: https://tools.ietf.org/html/rfc6749#section-5.2 | |||
finish: function() { | |||
finish: function($http) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree it's gorpy to require this here... @spadgett was looking into avoiding this
Switches to code authorization flow to avoid OAuth redirects containing access tokens.
Lays the groundwork for adding PKCE support to the web console.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1430456