# Can I expose a route with no authentication?

**URL:** https://meta.discourse.org/t/can-i-expose-a-route-with-no-authentication/162156
**Category:** Development
**Created:** [August 26, 2020, 5:28pm UTC](https://meta.discourse.org/t/can-i-expose-a-route-with-no-authentication/162156 "2020-08-26T17:28:05Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Stefan\_Brighiu\_M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stefan_brighiu_m/32/174499_2.png) [@Stefan\_Brighiu\_M](https://meta.discourse.org/u/Stefan_Brighiu_M)
#### Post date: [August 26, 2020, 9:07pm UTC](https://meta.discourse.org/t/can-i-expose-a-route-with-no-authentication/162156/4 "2020-08-26T21:07:46Z")

</div>

My rule is no anonymous accounts. So i cannot access the plugin routes. What I would need is a way for a route to be created for this type of scenario.

For example,

> ```
> # Default Rails 3.2 lets the request through with a blank session
> # we are being more pedantic here and nulling session / current_user
> # and then raising a CSRF exception
> def handle_unverified_request
> # NOTE: API key is secret, having it invalidates the need for a CSRF token
> unless is_api? || is_user_api?
> super
> clear_current_user
> render plain: "[\"BAD CSRF\"]", status: 403
> end
> end
> 
> ```

A way to notify during this flow or the whole flow of authentication that a controller and an action received via params (set automatically when you call a route) can bypass everything and execute the route.

I’m not fully aware of how everything works, but since there is an anonymous access option, I’m sure there is a way to do it.

This would allow for people to encrypt the payload if needed, but for generic information updating the system, it would be useful.

---

_[View the full topic](https://meta.discourse.org/t/can-i-expose-a-route-with-no-authentication/162156)._
