Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions lib/oidcc/plug/authorize.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ defmodule Oidcc.Plug.Authorize do
]
end
```

## Query Params

* `state` - State to relay to OpenID Provider. Commonly used for target redirect
URL after authorization.
"""
@moduledoc since: "0.1.0"

Expand Down Expand Up @@ -103,7 +98,8 @@ defmodule Oidcc.Plug.Authorize do
redirect_uri = opts |> Keyword.fetch!(:redirect_uri) |> evaluate_config()
client_profile_opts = Keyword.get(opts, :client_profile_opts, %{profiles: []})

state = Map.get(params, "state", :undefined)
state_authenticity = 31 |> :crypto.strong_rand_bytes() |> Base.url_encode64(padding: false)
state = state_authenticity <> Map.get(params, "state", "")
state_verifier = :erlang.phash2(state)

nonce = 31 |> :crypto.strong_rand_bytes() |> Base.url_encode64(padding: false)
Expand Down