# OAuthServer **Repository Path**: spring-security-nero/oauth-server ## Basic Information - **Project Name**: OAuthServer - **Description**: spring-authorization-server学习 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-27 - **Last Updated**: 2024-05-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # README ## device_code认证模式 [参考](https://www.oauth.com/oauth2-servers/device-flow/) The OAuth 2.0 “Device Flow” extension enables OAuth on devices that have an Internet connection but don’t have a browser or an easy way to enter text. If you’ve ever signed in to your YouTube account on a device such as the Apple TV, you’ve encountered this workflow already. Google was involved in the development of this extension, and has been an early implementer of it in production as well. This flow is also seen on devices such as smart TVs, media consoles, picture frames, printers, or hardware video encoders. In this flow, the device instructs the user to open a URL on a secondary device such as a smartphone or computer in order to complete the authorization. There is no communication channel required between the user’s two devices. ## 整体流程 ![整体流程](./image/DeviceCodeFlow.png) ## 详细步骤 ### 启动本代码 ![启动代码](./image/RunDemo.png) ### 请求device_code ![获取device_code](./image/GetDeviceCode.png) ### 验证device 用户通过手机或电脑等设备,打开上一步获取到的**verification_uri_complete** 1. 登录 ![登录](./image/Login.png) 2. 登录成功,跳转到确认页面 ![获取device_code](./image/comfirm.png) ### 获取token ![获取token](./image/GetToken.png)