-
Notifications
You must be signed in to change notification settings - Fork 90
feat: Add support for device code grant #229
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
base: master
Are you sure you want to change the base?
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.
Thanks for the PR! Can you rebase it? Here are some comments also
@@ -0,0 +1,76 @@ | |||
# Password grant handling |
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.
# Password grant handling | |
# Device grant handling |
|
||
class DeviceCodeController extends AbstractController | ||
{ | ||
|
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.
['form' => $form] | ||
); | ||
} | ||
|
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.
return $this->entityManager->createQueryBuilder() | ||
->select('dc') | ||
->from(DeviceCode::class, 'dc') | ||
->where('dc.userCode = :code') | ||
->setParameter('code', $code) | ||
->getQuery() | ||
->getOneOrNullResult(); | ||
} |
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.
return $this->entityManager->createQueryBuilder() | |
->select('dc') | |
->from(DeviceCode::class, 'dc') | |
->where('dc.userCode = :code') | |
->setParameter('code', $code) | |
->getQuery() | |
->getOneOrNullResult(); | |
} | |
return $this->entityManager->createQueryBuilder() | |
->select('dc') | |
->from(DeviceCode::class, 'dc') | |
->where('dc.userCode = :code') | |
->setParameter('code', $code) | |
->getQuery() | |
->getOneOrNullResult(); | |
} |
This PR adds support for device code grants, which has been available for some time in oauth2-server
Ready to be tested, I'd love to get some feedback if you think some areas could be improved !
Design considerations