Skip to content

Device Authorisation Grant Flow Quickstart#747

Draft
uzmamansoor09 wants to merge 3 commits intokeycloak:mainfrom
uzmamansoor09:735
Draft

Device Authorisation Grant Flow Quickstart#747
uzmamansoor09 wants to merge 3 commits intokeycloak:mainfrom
uzmamansoor09:735

Conversation

@uzmamansoor09
Copy link
Copy Markdown

@uzmamansoor09 uzmamansoor09 commented Apr 22, 2026

Closes #733, #734, #735, #736, #737, #738
Adding device 1 and device 2 implementation for the device authorisation grant flow quickstart

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new device Maven module intended to demonstrate Keycloak’s OAuth 2.0 Device Authorization Grant (Device Flow) using Spring Boot + Thymeleaf.

Changes:

  • Registers a new device module in the root Maven reactor.
  • Introduces a Spring Boot web app skeleton (controller/service + Thymeleaf templates) and DTOs for device authorization responses.
  • Adds a Keycloak realm import and module-level README/configuration.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
pom.xml Adds the new device module to the multi-module build.
device/pom.xml New module POM with Spring Boot dependencies and build plugin configuration.
device/src/main/java/org/keycloak/quickstarts/DeviceApplication.java Spring Boot entrypoint for the new module.
device/src/main/java/org/keycloak/quickstarts/DeviceController.java MVC endpoints to start device flow and (intended) token display/logout.
device/src/main/java/org/keycloak/quickstarts/DeviceFlowService.java RestClient-based call to Keycloak device authorization endpoint and state handling.
device/src/main/java/org/keycloak/quickstarts/DeviceResponse.java DTO for device authorization response JSON.
device/src/main/java/org/keycloak/quickstarts/TokenResponse.java DTO for token endpoint response JSON.
device/src/main/resources/templates/index.html Start page with “Log in” action to initiate device flow.
device/src/main/resources/templates/device-info.html Displays verification URI and user code.
device/src/main/resources/application.properties Basic app config (name/port/Thymeleaf cache).
device/config/realm-import.json Keycloak realm/client/user configuration for the device flow.
device/README.md Usage instructions and conceptual overview for the quickstart.
device/.DS_Store macOS metadata file added to repo (should not be committed).
.DS_Store macOS metadata file added to repo root (should not be committed).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread device/README.md
Comment thread device/src/main/java/org/keycloak/quickstart/DeviceFlowService.java
Comment thread device/pom.xml
Comment thread device/src/main/java/org/keycloak/quickstarts/DeviceController.java
Comment thread device/src/main/java/org/keycloak/quickstarts/DeviceApplication.java Outdated
Comment thread device/pom.xml Outdated
Comment thread device/pom.xml Outdated
Comment thread device/src/main/java/org/keycloak/quickstart/DeviceFlowService.java
Comment thread device/README.md
Signed-off-by: uzmamansoor09 <Uzma.Mansoor@ibm.com>
Comment thread device/src/main/java/org/keycloak/quickstart/DeviceResponse.java
Comment thread device/src/main/java/org/keycloak/quickstart/DeviceFlowService.java
Comment thread device/src/main/java/org/keycloak/quickstart/DeviceController.java
Comment thread device/pom.xml
Comment thread device/src/main/java/org/keycloak/quickstart/DeviceController.java
@uzmamansoor09 uzmamansoor09 changed the title Device 1 implementation Device Authorisation Grant Flow Quickstart Apr 27, 2026
@uzmamansoor09 uzmamansoor09 force-pushed the 735 branch 2 times, most recently from 0a09228 to e0aa822 Compare April 27, 2026 12:12
Signed-off-by: uzmamansoor09 <Uzma.Mansoor@ibm.com>
Comment thread device/README.md Outdated
Comment thread device/README.md Outdated
Signed-off-by: uzmamansoor09 <Uzma.Mansoor@ibm.com>
Copy link
Copy Markdown
Contributor

@rmartinc rmartinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @uzmamansoor09! Looks very good. Just one request. The quickstarts run the CI when doing the pull like in the main keycloak repo, I prefer to run the device in its specific job (that's why I asked you to remove the module in the pom.xml) . Can you please add the new device folder in the CI?

For example, you can use something similar to what I have done in this commit b1713ad. You can check the tests pass OK in your branch (actions tab in github).

Comment thread pom.xml

<modules>
<module>misc</module>
<module>device</module>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line. It's not needed now that the tests are run in the specific device job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Keycloak Device Authorization Grant Quickstart

4 participants