# Authentik oauth setup

**URL:** <https://discuss.write.as/t/authentik-oauth-setup/8271>\
**Category:** Help\
**Tags:** writefreely\
**Created:** [February 8, 2023, 4:18pm UTC](https://discuss.write.as/t/authentik-oauth-setup/8271 "2023-02-08T16:18:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tealk](https://discuss.write.as/user_avatar/discuss.write.as/tealk/32/1323_2.png) [@Tealk](https://discuss.write.as/u/Tealk)\
**Post date:** [February 8, 2023, 4:18pm UTC](https://discuss.write.as/t/authentik-oauth-setup/8271/1 "2023-02-08T16:18:30Z")

</div>

I have the same Problem with authentik, if I try to log in I get `{"error":"unable to inspect access token"}`

```auto
[oauth.generic]
client_id = ###hidden###
client_secret = ###hidden###
host = https://auth.rollenspiel.monster
display_name = authentik
callback_proxy =
callback_proxy_api =
token_endpoint = /application/o/token/
inspect_endpoint = /application/o/userinfo/
auth_endpoint = /application/o/authorize/
scope = user
allow_disconnect = false
map_user_id = uid
map_username = username
map_display_name = name
map_email = email

```

---

<div class="post-metadata">

**Author:** ![Tealk](https://discuss.write.as/user_avatar/discuss.write.as/tealk/32/1323_2.png) [@Tealk](https://discuss.write.as/u/Tealk)\
**Post date:** [February 9, 2023, 7:11pm UTC](https://discuss.write.as/t/authentik-oauth-setup/8271/2 "2023-02-09T19:11:55Z")

</div>

So with the following setting, I get redirected back to writefreely and now get the message “User doesn’t exist.”

```auto
token_endpoint = /application/o/token/
inspect_endpoint = /application/o/userinfo/
auth_endpoint = /application/o/authorize/
scope = openid profile email
allow_disconnect = false
map_user_id = nickname
map_username = nickname
map_display_name = name
map_email = email

```

---

<div class="post-metadata">

**Author:** ![matt](https://discuss.write.as/user_avatar/discuss.write.as/matt/32/2760_2.png) [@matt](https://discuss.write.as/u/matt)\
**Post date:** [February 16, 2023, 4:49pm UTC](https://discuss.write.as/t/authentik-oauth-setup/8271/3 "2023-02-16T16:49:54Z")

</div>

Can you share your server logs from around the time you get redirected? There might be more information there.

---

<div class="post-metadata">

**Author:** ![Tealk](https://discuss.write.as/user_avatar/discuss.write.as/tealk/32/1323_2.png) [@Tealk](https://discuss.write.as/u/Tealk)\
**Post date:** [February 16, 2023, 5:51pm UTC](https://discuss.write.as/t/authentik-oauth-setup/8271/4 "2023-02-16T17:51:38Z")

</div>

which log exactly would you like?  
this one?:

```auto
Feb 16 18:48:54 writefreely writefreely[767237]: 2023/02/16 18:48:54 "GET /" 200 2.023941ms "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
Feb 16 18:48:54 writefreely writefreely[767237]: 2023/02/16 18:48:54 "GET /js/menu.js" 200 120.987µs "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
Feb 16 18:48:55 writefreely writefreely[767237]: 2023/02/16 18:48:55 "POST /api/collections/ein-leben-in-den-verbotenen-landen/inbox" 200 1.197114ms "http.rb/5.1.0 (Mastodon/4.0.2+glitch; +https://eightpoint.app/)"
Feb 16 18:48:56 writefreely writefreely[767237]: 2023/02/16 18:48:56 "GET /login" 200 384.4µs "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
Feb 16 18:48:57 writefreely writefreely[767237]: 2023/02/16 18:48:57 "POST /api/collections/taarion/inbox" 200 973.103µs "http.rb/5.1.0 (Mastodon/4.0.2+glitch; +https://eightpoint.app/)"
Feb 16 18:49:07 writefreely writefreely[767237]: 2023/02/16 18:49:07 "GET /oauth/generic" 307 999.212µs "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
Feb 16 18:49:08 writefreely writefreely[767237]: 2023/02/16 18:49:08 "GET /oauth/callback/generic?code=e4e4ae55805249369e26abd9e79a23f8&state=xK7OldlKWngoy0LP6VWI8FyE" 302 363.304365ms "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
Feb 16 18:49:08 writefreely writefreely[767237]: 2023/02/16 18:49:08 "GET /login" 200 421.169µs "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
Feb 16 18:49:09 writefreely writefreely[767237]: 2023/02/16 18:49:09 "GET /fonts/Lora-Italic.woff2" 200 129.071µs "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"

```

---

<div class="post-metadata">

**Author:** ![Tealk](https://discuss.write.as/user_avatar/discuss.write.as/tealk/32/1323_2.png) [@Tealk](https://discuss.write.as/u/Tealk)\
**Post date:** [February 26, 2023, 11:34am UTC](https://discuss.write.as/t/authentik-oauth-setup/8271/5 "2023-02-26T11:34:51Z")

</div>

Looks like a feature/bug

> [@Oauth also with closed registration](https://discuss.write.as/t/oauth-also-with-closed-registration/8365):
>
> Hello, I want to run my Writefreely instance with oauth only, unfortunately this only works if I set open\_registration = true. Otherwise the oauth provider can not create accounts. I came across it because of [this error message](https://discuss.write.as/t/authentik-oauth-setup/8271/2). I have decided to use oauth because a normal open registration brings in an incredible amount of spam and users only need one account for several services.
