-
Hi all, defmodule TestWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :test
...
plug Oidcc.Plug.ExtractAuthorization
plug Oidcc.Plug.ValidateJwtToken,
provider: Test.OidccConfigProvider,
client_id: @client_id,
client_secret: @client_secret,
send_inactive_token_response: &TestWeb.Endpoint.halt_conn/1
plug TestWeb.Router
end It blocks requests that contain invalid tokens. However, it does not block requests that do not contain the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@alishir We currently do not offer a plug to check if an authorization exists, only if it is valid. For a lot of APIs, no auth is also valid and the result might just depend on if you’re logged in. You‘ll therefore have to create your own plug to protect routes. If you‘d like, I‘d be open for a PR that adds a new plug that does this. |
Beta Was this translation helpful? Give feedback.
@alishir We currently do not offer a plug to check if an authorization exists, only if it is valid.
For a lot of APIs, no auth is also valid and the result might just depend on if you’re logged in.
You‘ll therefore have to create your own plug to protect routes.
If you‘d like, I‘d be open for a PR that adds a new plug that does this.