Skip to content

Commit

Permalink
access: revert regression issue introduced by ory#150
Browse files Browse the repository at this point in the history
  • Loading branch information
budougumi0617 committed May 3, 2017
1 parent 9791a7e commit d4a1685
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions access_request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ func (f *Fosite) NewAccessRequest(ctx context.Context, r *http.Request, session
}

// Decode client_id and client_secret which should be in "application/x-www-form-urlencoded" format.
var clientID, clientSecret string
if id, secret, ok := r.BasicAuth(); !ok {
clientID, clientSecret, ok := r.BasicAuth()
if !ok {
return accessRequest, errors.Wrap(ErrInvalidRequest, "HTTP authorization header missing or invalid")
} else if clientID, err = url.QueryUnescape(id); err != nil {
return accessRequest, errors.Wrap(ErrInvalidRequest, `The client id in the HTTP authorization header could not be decoded from "application/x-www-form-urlencoded"`)
} else if clientSecret, err = url.QueryUnescape(secret); err != nil {
return accessRequest, errors.Wrap(ErrInvalidRequest, `The client secret in the HTTP authorization header could not be decoded from "application/x-www-form-urlencoded"`)
}

client, err := f.Store.GetClient(clientID)
Expand Down

0 comments on commit d4a1685

Please sign in to comment.