-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Improve OAuth handling #9517
Improve OAuth handling #9517
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.
cannot say much about it… but at least some bikeshedding
* @return RedirectResponse | ||
*/ | ||
public function authorize($client_id, | ||
$state) { | ||
$state, | ||
$response_type) { |
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.
camelCase?
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.
No I can't change those as they are post variables and defined in the OAuth spec
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.
okay then
* @return JSONResponse | ||
*/ | ||
public function getToken($code) { | ||
$accessToken = $this->accessTokenMapper->getByCode($code); | ||
public function getToken($grant_type, $code, $refresh_token, $client_id, $client_secret) { |
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.
cases
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.
No I can't change those as they are post variables and defined in the OAuth spec
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.
okay then
// Set the 3600 second timeout on all tokens | ||
foreach ($tokens as $token) { | ||
try { | ||
$appToken = $this->tokenProvider->getTokenById($token->getTokenId()); |
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.
would it have a better memory footprint if we deal with that inside the while-loop above?
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.
yes fair enough let me fix that...
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.
done
3580a75
to
a7568bc
Compare
Codecov Report
@@ Coverage Diff @@
## master #9517 +/- ##
========================================
Coverage ? 51.7%
Complexity ? 25757
========================================
Files ? 1644
Lines ? 96569
Branches ? 1393
========================================
Hits ? 49932
Misses ? 46637
Partials ? 0
|
} | ||
|
||
// The client id and secret must match. Else we don't provide an access token! | ||
if ($client->getClientIdentifier() !== $client_id || $client->getSecret() !== $client_secret) { |
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.
with grant_type = 'refresh_token' client_id and and secret are not provided. Unless I oversaw a thing? yes, i did, all right
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.
looks good to me
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.
Code looks good
Found one unused variable
|
||
$cursor = $qb->execute(); | ||
|
||
$tokens = []; |
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.
unused
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.
Fixed
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
On a refresh token request: * rorate * reset expire Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
a7568bc
to
461998d
Compare
No description provided.