GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Device authorization codes request should include client_secret · Issue #1041 · scribejava/scribejava

Device authorization codes request should include client_secret #1041

New issue
Copy link
New issue
Copy link
Open
Open
Device authorization codes request should include client_secret#1041
Copy link

Description

@danielFesenmeyer
danielFesenmeyer
opened on Jun 30, 2022
Issue body actions

Currently, the device authorization codes request does not include the client_secret parameter (aka apiKey).

The OAuth 2.0 Device Grant RFC states [1]:

The client authentication requirements of Section 3.2.1 of [RFC6749] apply to requests on this endpoint, which means that confidential clients (those that have established client credentials) authenticate in the same manner as when making requests to the token endpoint...

Hence, the method OAuth20Service#createDeviceAuthorizationCodesRequest(String) should not only set the client_id, but also the client_secret here [2].
Imho the line
request.addParameter(OAuthConstants.CLIENT_ID, getApiKey());
should be replaced with:
api.getClientAuthentication().addClientAuthentication(request, getApiKey(), getApiSecret());

I observed this issue when trying to test device authorization with a confidential Keycloak client - I got a Keycloak response 401 with body:
{"error":"unauthorized_client","error_description":"Client secret not provided in request"}

[1] https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
[2]

scribejava/scribejava-core/src/main/java/com/github/scribejava/core/oauth/OAuth20Service.java

Line 506 in 3a07d71

request.addParameter(OAuthConstants.CLIENT_ID, getApiKey());

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.