spring-projects / spring-authorization-server

Spring Authorization Server
https://spring.io/projects/spring-authorization-server
Apache License 2.0
4.83k stars 1.27k forks source link

Device Code Consent Page Got EMPTY SCOPE caused "Access Denied" #1718

Open Code-SkyWalker opened 1 week ago

Code-SkyWalker commented 1 week ago

Describe the bug using Demo. when jump to "http://auth.javaboy.org:9000/activate?user_code=PFNW-XBMR" and then redirect to "http://auth.javaboy.org:9000/oauth2/consent?scope=&client_id=device-client-id&state=tOX0gviDMLqw5-qiCQbnryFS6_Z0hUQx7k1cng26tCI%3D&user_code=PFNW-XBMR", The scope is empty.

FOUND : OAuth2DeviceVerificationEndpointFilter#doFilterInternal THE METHOD this.sendAuthorizationConsent(request, response, authenticationResult): "Set requestedScopes = authorizationConsentAuthentication.getRequestedScopes();" is empty;

Problems found in spring-security-oauth2-authorization-server: 1.1.7, 1.2.1, 1.3.1 Success in spring-security-oauth2-authorization-server 1.1.1

jgrandja commented 4 days ago

@Code-SkyWalker I tested the demo sample on 1.3.1 and it works as expected.

Please provide a minimal sample that reproduces this issue and I'll look into it further.

Code-SkyWalker commented 4 days ago

Sorry, Here is the minimal sample, if i did anything wrong please let me know