Kragrathea / pgcode

118 stars 19 forks source link

Very VERY basic example of auth using username/pass #4

Closed PrimusNZ closed 3 years ago

PrimusNZ commented 3 years ago

Please for the love of all things holy, dont use this code nor merge to the main branch - However this is how I got auth working on my setup (Since my moonraker requires a username and pass to login)

user and pass are passed in the query string: user=abc&pass=123

Doesnt refresh the token after the token expires (Moonraker tokens expire after 1 hour) as per: https://moonraker.readthedocs.io/en/latest/web_api/#login-user

Providing so you can use as a base to implement a MUCH BETTER solution than this very dirty hack.

Kragrathea commented 3 years ago

Hey @PrimusNZ. I have a new version on the Dev branch that supports moonraker apiKey via a url param. I am still working on integrating this change to allow user/pass login.