#Its possibile via bash to create a auto login

1 messages · Page 1 of 1 (latest)

light zodiac
#

define "auto login"

hidden summit
#

And why bash?

light merlin
#

I have a nextcloud on my raspberry pi

#

but how I can catch the pdfs? that they auto upload to my nextcloud

#

I read something about cron jobs but this is only the time interval how often this bash script should run

light merlin
#

@light zodiac @hidden summit

light zodiac
#

I don't see the point in doing this with bash but sure, you can just send the same request your browser would send

light merlin
#

yeah I build this but the link is changeing

#

and I don't know how to get the generated link

#

And my main goal is to log in to this portal + go to the download area and download the PDF datein and load it into my nextcloud

#

and then I create a cron job that the bash run ever 6hours

light zodiac
#

Yes so do that?

light merlin
#

jeah but if I try it it say my access is denied

#

I think its because the auth part ist missing

light zodiac
#

So then properly copy the auth part from your browser?

#

You'll have to make the login request of course

#

and then take that token?

light merlin
#

this is the url I use

#

but my browser do a link forward to

#

I think this is the reason why it doesnt work

#
#!/bin/bash

# URL der Authentifizierungsseite
AUTH_URL="https://portal.leg-wohnen.de/app/"

# Benutzerdaten
USERNAME="dein_benutzername"
PASSWORD="dein_passwort"

# Cookies-Datei
COOKIES_FILE="cookies.txt"
> $COOKIES_FILE

# Authentifizierungsanfrage senden
response=$(curl -s -c $COOKIES_FILE -d "username=$USERNAME&password=$PASSWORD" -X POST $AUTH_URL)

# Überprüfen, ob die Authentifizierung erfolgreich war
if echo "$response" | grep -q "success"; then
    echo "Authentifizierung erfolgreich"
else
    echo "Authentifizierung fehlgeschlagen"
fi
#

the only thing that can be is that the link is wrong

#

but I cant find something like https://..../login

light zodiac
#

Did you ChatGPT that

light merlin
#

sure

#

but I dont realy know what is missing

light zodiac
#

Go log in in your browser and check the network tab?

light merlin
#

yes I do it but the link is the same

light zodiac
#

The link to where your credentials are posted?

#

I don't think so

light zodiac
#

Yeah but that's not the actual log in?

light merlin
#

should I login first?

#

and sry its the first time that I do it witch bash

light zodiac
#

You need the actual request that logs you in wdym

#

Do it with another language you're more comfortable in then

#

no idea why you want to use bash

light merlin
#

I want to integrate it in my nextcloud

#

and if there is a api or a ftp server that is easy

light zodiac
#

just use whatever language you're most comfortable with

light merlin
#

wait u mean the comunication between us or programming lanuage?

light zodiac
#

Programming language💀

light merlin
#

kann es sonnst auch auf deutsch schreiben

light zodiac
#

nimm einfach irgendeine sprache die du kannst und nicht bash💀💀

light merlin
#

hahahah ich kann c# php js nur ales semi gut

#

was mich nervt ist das ich nicht raffe wie ich mich in diese website einloggen kann

light zodiac
#

Mach halt den Login normal und schau welche request abgeschickt wird beim login

#

POST irgendwas

light merlin
#

ach ne dasist ne get

light zodiac
#

da POST token

#

das ist deine request viel spaß

light merlin
#

einfach nur copy paste?

light zodiac
#

Die Request musst du in deinem Code nachbauen dann kriegst du den token zurück

light zodiac
light merlin
#

ich bin verwirrt XD

#

ich probiere das mal damit