# `AshAuthentication.Strategy.DynamicOidc.Plug`
[🔗](https://github.com/team-alembic/ash_authentication/blob/main/lib/ash_authentication/strategies/dynamic_oidc/plug.ex#L5)

Handlers for `dynamic_oidc` HTTP requests.

Wraps the standard OAuth2 plug logic with a connection lookup step:

  - **Request**: extracts `:connection_id` from the path, loads the matching
    row from the configured connection resource (scoped by the current
    Ash tenant), populates the strategy struct with the row's `base_url`,
    `client_id`, and `client_secret`, and stores the connection id in
    session alongside Assent's CSRF state.
  - **Callback**: reads the connection id back from session, loads the row
    again, populates the strategy, and runs the standard callback flow.

# `callback`

```elixir
@spec callback(Plug.Conn.t(), AshAuthentication.Strategy.DynamicOidc.t()) ::
  Plug.Conn.t()
```

Handle the IdP redirect back to our app after the user authenticated.

# `request`

```elixir
@spec request(Plug.Conn.t(), AshAuthentication.Strategy.DynamicOidc.t()) ::
  Plug.Conn.t()
```

Initiate sign-in for the connection identified in the request path.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
