Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip dropping request on code request parameter #529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ricristian
Copy link

@ricristian ricristian commented Nov 5, 2024

By default if someone makes a GET request with parameter &code=... after authentication against IdP
classic error request to the redirect_uri path but there's no session state found will be raised.

I believe that it's related to

local function openidc_get_path(uri)
  local without_query = uri:match("(.-)%?") or uri
  return without_query:match(".-//[^/]+(/.*)") or without_query
end

Where basically &code matches the regex which triggers authorization response from OP.

&code= alone without extra request parameter should be treated as authorization response ?

Eventough I don't believe that this is a viable solution but the issue seems to be present

By default if someone makes a GET /?code= as request parameter `&code=...` error `request to the redirect_uri path but there's no session state found` will be raised. 

I believe that it's related to 

```
local function openidc_get_path(uri)
  local without_query = uri:match("(.-)%?") or uri
  return without_query:match(".-//[^/]+(/.*)") or without_query
end
```

Where basically &code matches the regex which triggers authorization response from OP. 

`&code=` alone without extra request parameter  should be treated as authorization response ? 

Eventough I don't believe that this is a viable solution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant