# Forward Auth with own Auth Server

**URL:** <https://community.traefik.io/t/forward-auth-with-own-auth-server/10736>\
**Category:** Traefik v2\
**Tags:** middleware\
**Created:** [May 26, 2021, 12:10pm UTC](https://community.traefik.io/t/forward-auth-with-own-auth-server/10736 "2021-05-26T12:10:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewtTheWolf](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/newtthewolf/32/3826_2.png) [@NewtTheWolf](https://community.traefik.io/u/NewtTheWolf)\
**Post date:** [May 26, 2021, 12:10pm UTC](https://community.traefik.io/t/forward-auth-with-own-auth-server/10736/1 "2021-05-26T12:10:29Z")

</div>

Hello I have now decided to use Traefik because it brings many advantages Now I would like to use the middleware "Forward Auth". The problem is that I want to program an auth server myself that allows a Discord login, the problem is that Traefik only reacts on a status of `2xx` but a redirect is a `3xx` , can I solve this somehow differently?

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [May 29, 2021, 8:09pm UTC](https://community.traefik.io/t/forward-auth-with-own-auth-server/10736/2 "2021-05-29T20:09:18Z")

</div>

Hi @NewtTheWolf

> The ForwardAuth middleware delegates authentication to an external service. If the service answers with a 2XX code, access is granted, and the original request is performed. Otherwise, the response from the authentication server is returned.

So if the auth server returns a 3xx if returned from the Authforward server then that response will be returned to the requester.
