login=admin&realm=admin&password=yourpassword
You may call it as a post request...
The important part is, you get a cookie called "privacyidea_session".
2. Now you need to pass this cookie as cookie and also the contents of the cookie
in the html paramter "session".
You are welcome to ask again - since in fact it is a bit tricky ;-)
Kind regards
Cornelius
Hi Paolo,Hello :)with this script I save the content of the response cookie to a file:
s = requests.Session()s.cookies = LWPCookieJar('cookiejar')if not os.path.exists('cookiejar'):print('setting cookies')
s.cookies.save()r = s.post('https://localhost:5001/account/dologin?login=username&realm=myrealm&password=mysuperpwd', verify=False)
s.cookies.save(ignore_discard=True)
file content:
#LWP-Cookies-2.0Set-Cookie3: privacyidea_session="\"cd894d49ff6396f48b249a14783782110552c0bcUSERNAME!\""; path="/"; domain="localhost.local"; path_spec; discard; version=0
Now what I have to do is the number 1 or the number 2??
- send a POST/GET request to https://localhost:5001/admin/init?serial=12345678&type=TOTP&genkey=1 with the cookie (sending the file)
- send a POST/GET request to https://localhost:5001/admin/init?serial=12345678&type=TOTP&genkey=1&session=cd894d49ff6396f48b249a14783782110552c0bcUSERNAME! (adding the privacyidea_session as a url parameter)
Thanks a lot again :)
--
You received this message because you are subscribed to the Google Groups "privacyidea" group.
To unsubscribe from this group and stop receiving emails from it, send an email to privacyidea...@googlegroups.com.
To post to this group, send email to priva...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privacyidea/3762c92e-81db-46db-8d2d-049acff05266%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "privacyidea" group.
To unsubscribe from this group and stop receiving emails from it, send an email to privacyidea...@googlegroups.com.
To post to this group, send email to priva...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privacyidea/3e7160e5-8669-4eee-9996-2e1ce37e42da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Cornelius Kölbel corneliu...@netknights.it +49 151 2960 1417 NetKnights GmbH http://www.netknights.it Landgraf-Karl-Str. 19, 34131 Kassel, Germany Tel: +49 561 3166797, Fax: +49 561 3166798 Amtsgericht Kassel, HRB 16405 Geschäftsführer: Cornelius Kölbel
--
You received this message because you are subscribed to the Google Groups "privacyidea" group.
To unsubscribe from this group and stop receiving emails from it, send an email to privacyidea...@googlegroups.com.
To post to this group, send email to priva...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privacyidea/462fa265-388e-45cf-9e0c-3890f8ba461f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "privacyidea" group.
To unsubscribe from this group and stop receiving emails from it, send an email to privacyidea...@googlegroups.com.
To post to this group, send email to priva...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privacyidea/462fa265-388e-45cf-9e0c-3890f8ba461f%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privacyidea/e6fe7683-ff80-40cc-9ada-fb1aaeae5445%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "privacyidea" group.
To unsubscribe from this group and stop receiving emails from it, send an email to privacyidea...@googlegroups.com.
To post to this group, send email to priva...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privacyidea/249de54f-e8d6-4c5b-999a-1333b4ffcb5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "privacyidea" group.
To unsubscribe from this group and stop receiving emails from it, send an email to privacyidea...@googlegroups.com.
To post to this group, send email to priva...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privacyidea/6440770e-5287-44cb-9602-11445cbfba94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.