You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
There is a strange behavior when I generate a cookie via authentik. I end up on the login page. All I have to do is click on login without filling in any fields and it skips the login page.
Describe the solution you'd like
One solution is to set up an oauth system or a petio refresh test if a cross-site cookie is detected. It'll be cleaner
This is a scope's authentik for petio (I was inspired by your source codes) :
from authentik.sources.plex.models import PlexSourceConnection
import json
from datetime import datetime, timedelta
connection = PlexSourceConnection.objects.filter(user=request.user).first()
if not connection:
return {}
petio_url = "http://192.168.1.190:7777/api/login/plex_login"
def get_client_ip(request):
x_forwarded_for = request.http_request.META['HTTP_X_FORWARDED_FOR']
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = http_request.META['REMOTE_ADDR']
return ip
headers = {
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded",
"X-Forwarded-For": get_client_ip(request)
}
data = {
"user": {
"username": "",
"password": "",
"type": 1,
},
'authToken': False,
'token': connection.plex_token
}
response = requests.post(petio_url, headers=headers, data=data, verify=False, timeout=60, allow_redirects=True)
user = response.json().get('user')
if (response.status_code != 200):
return {}
token = response.json().get('token')
return {
"ak_proxy": {
"user_attributes": {
"additionalHeaders": {
"Cookie": f"petio_jwt={token}; expires={(datetime.now() + timedelta(days=1)).strftime('%a, %d %b %Y %H:%M:%S')} GMT;"
}
}
}
}
When I click to go to petio from my authentik interface, authentik generates the cookie and adds it to the header
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
There is a strange behavior when I generate a cookie via authentik. I end up on the login page. All I have to do is click on login without filling in any fields and it skips the login page.
Describe the solution you'd like
One solution is to set up an oauth system or a petio refresh test if a cross-site cookie is detected. It'll be cleaner
This is a scope's authentik for petio (I was inspired by your source codes) :
When I click to go to petio from my authentik interface, authentik generates the cookie and adds it to the header
The text was updated successfully, but these errors were encountered: