Skip to content

Commit

Permalink
Pass information via URL
Browse files Browse the repository at this point in the history
  • Loading branch information
supercairos committed Aug 30, 2022
1 parent 5367ee9 commit 1f0468f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
10 changes: 3 additions & 7 deletions consent/strategy_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,11 @@ func (s *DefaultStrategy) forwardAuthenticationRequest(w http.ResponseWriter, r

// Generate the request URL
iu := s.c.OAuth2AuthURL()
iu.RawQuery = r.URL.RawQuery

// Identify requester type
if _, ok := ar.(fosite.AuthorizeRequester); ok {
iu = s.c.OAuth2AuthURL()
} else if _, ok := ar.(*fosite.DeviceAuthorizeRequest); ok {
if _, ok := ar.(*fosite.DeviceAuthorizeRequest); ok {
iu = s.c.OAuth2DeviceAuthorisationURL()
}

iu.RawQuery = r.URL.RawQuery

var idTokenHintClaims jwtgo.MapClaims
if idTokenHint := ar.GetRequestForm().Get("id_token_hint"); len(idTokenHint) > 0 {
claims, err := s.getIDTokenHintClaims(r.Context(), idTokenHint)
Expand Down
2 changes: 1 addition & 1 deletion oauth2/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ func (h *Handler) DeviceAuthHandler(w http.ResponseWriter, r *http.Request, _ ht

// Generate the request URL
reqURL := h.c.OAuth2DeviceAuthorisationURL()
reqURL.RawQuery = r.URL.RawQuery
reqURL.RawQuery = deviceAuthorizeRequest.GetRequestForm().Encode()

csrf := strings.Replace(uuid.New(), "-", "", -1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ CREATE TABLE IF NOT EXISTS hydra_oauth2_device_link_request
oidc_context TEXT NOT NULL,
login_challenge VARCHAR(40) NULL REFERENCES hydra_oauth2_authentication_request (challenge) ON DELETE SET NULL,
requested_at_audience TEXT NOT NULL DEFAULT '',
context TEXT NOT NULL DEFAULT '{}',
UNIQUE (challenge)
);

Expand All @@ -35,7 +34,7 @@ CREATE TABLE IF NOT EXISTS hydra_oauth2_device_code
active INTEGER NOT NULL DEFAULT true,
requested_audience TEXT NULL DEFAULT '',
granted_audience TEXT NULL DEFAULT '',
challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_device_link_request (challenge) ON DELETE CASCADE,
challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_consent_request (challenge) ON DELETE CASCADE,
UNIQUE (request_id)
);

Expand Down

0 comments on commit 1f0468f

Please sign in to comment.